{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f34\fbidi \froman\fcharset1\fprq2{\*\panose 02040503050406030204}Cambria Math;}
{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f40\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f41\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f43\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f44\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f45\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f46\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
{\f47\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f48\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f60\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f61\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
{\f63\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f64\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f65\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f66\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
{\f67\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f68\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f410\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f411\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
{\f413\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f414\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f417\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}
{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
\red192\green192\blue192;}{\*\defchp \f31506\fs22 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 \styrsid6389675 Normal;}{
\s1\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs48\alang1025 \ltrch\fcs0 \b\fs48\lang1033\langfe1033\kerning36\cgrid\langnp1033\langfenp1033 
\sbasedon0 \snext1 \slink15 \sqformat \spriority9 \styrsid9441560 heading 1;}{\s2\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs36\alang1025 
\ltrch\fcs0 \b\fs36\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext2 \slink16 \sqformat \spriority9 \styrsid9441560 heading 2;}{
\s3\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs27\alang1025 \ltrch\fcs0 \b\fs27\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 
\sbasedon0 \snext3 \slink17 \sqformat \spriority9 \styrsid9441560 heading 3;}{\s4\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel3\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs24\alang1025 
\ltrch\fcs0 \b\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext4 \slink18 \sqformat \spriority9 \styrsid9441560 heading 4;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1
\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\*\cs15 
\additive \rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\kerning36 \sbasedon10 \slink1 \slocked \spriority9 \styrsid9441560 Heading 1 Char;}{\*\cs16 \additive \rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36 
\sbasedon10 \slink2 \slocked \spriority9 \styrsid9441560 Heading 2 Char;}{\*\cs17 \additive \rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27 \sbasedon10 \slink3 \slocked \spriority9 \styrsid9441560 Heading 3 Char;}{\*\cs18 \additive \rtlch\fcs1 
\ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24 \sbasedon10 \slink4 \slocked \spriority9 \styrsid9441560 Heading 4 Char;}{\*\cs19 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid9441560 apple-style-span;}{
\s20\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 
\sbasedon0 \snext20 \ssemihidden \sunhideused \styrsid9441560 Normal (Web);}{\*\cs21 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 \styrsid9441560 apple-converted-space;}{\*\cs22 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 
\sbasedon10 \ssemihidden \sunhideused \styrsid9441560 Hyperlink;}{\*\cs23 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf12 \sbasedon10 \ssemihidden \sunhideused \styrsid9441560 FollowedHyperlink;}{\s24\ql \li0\ri0\widctlpar
\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 
\f2\fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext24 \slink25 \ssemihidden \sunhideused \styrsid9441560 HTML Preformatted;}{\*\cs25 \additive \rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20 
\sbasedon10 \slink24 \slocked \ssemihidden \styrsid9441560 HTML Preformatted Char;}}{\*\listtable{\list\listtemplateid-671475100{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid135297494}{\list\listtemplateid421846886{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid669452094}{\list\listtemplateid-113106898{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid760495042}{\list\listtemplateid1657720702{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid807360922}{\list\listtemplateid-1916617740{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid841970010}{\list\listtemplateid-1301134866{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid881525538}{\list\listtemplateid728902074{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid927738292}{\list\listtemplateid-386631544{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1040131020}{\list\listtemplateid-573566314{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1515074122}{\list\listtemplateid1908438108{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1696954874}{\list\listtemplateid-1347153898{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1714160958}{\list\listtemplateid142486402{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1728842648}{\list\listtemplateid-1072794702{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1882857566}{\list\listtemplateid999567138{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
\'01\u-3913 ?;}{\levelnumbers;}\f3\fs20\fbias0\hres0\chhres0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}
\f2\fs20\fbias0\hres0\chhres0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
\f10\fs20\fbias0\hres0\chhres0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid2072801511}}{\*\listoverridetable{\listoverride\listid760495042\listoverridecount0\ls1}{\listoverride\listid1882857566\listoverridecount0\ls2}
{\listoverride\listid1728842648\listoverridecount0\ls3}{\listoverride\listid1040131020\listoverridecount0\ls4}{\listoverride\listid881525538\listoverridecount0\ls5}{\listoverride\listid1515074122\listoverridecount0\ls6}{\listoverride\listid807360922
\listoverridecount0\ls7}{\listoverride\listid1696954874\listoverridecount0\ls8}{\listoverride\listid927738292\listoverridecount0\ls9}{\listoverride\listid669452094\listoverridecount0\ls10}{\listoverride\listid1714160958\listoverridecount0\ls11}
{\listoverride\listid841970010\listoverridecount0\ls12}{\listoverride\listid135297494\listoverridecount0\ls13}{\listoverride\listid2072801511\listoverridecount0\ls14}}{\*\pgptbl {\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid6389675\rsid9441560}
{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\author  Paul Nicholls}{\operator  Paul Nicholls}{\creatim\yr2011\mo6\dy22\hr17\min6}{\revtim\yr2011\mo6\dy22\hr17\min7}
{\version1}{\edmins1}{\nofpages47}{\nofwords15202}{\nofchars86654}{\*\company Altium Limited}{\nofcharsws101653}{\vern32771}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}}
\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect 
\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen
\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1
\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
\asianbrkrule\rsidroot9441560\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0
{\*\wgrffmtfilter 2450}\nofeaturethrottle1\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}
{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9
\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\qc \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 \rtlch\fcs1 
\af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 An Introduction to Programming C-64 Demos
\par }\pard \ltrpar\qc \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Puterman}{\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \line }{\rtlch\fcs1 \ai\af0\afs20 \ltrch\fcs0 \i\f0\fs20\cf1\insrsid9441560\charrsid9441560 puterman at fairlight st
}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \line }{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \f0\fs20\cf1\insrsid9441560\charrsid9441560 aka Linus 
\'c5kerlund}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 10070188}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn alignHR}{\sv 1}}{\sp{\sn dxHeightHR}{\sv 30}}
{\sp{\sn fStandardHR}{\sv 1}}{\sp{\sn fHorizRule}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex936\picscaley6\piccropl0\piccropr0\piccropt0\piccropb0
\picw1764\pich882\picwgoal1000\pichgoal500\wmetafile8\bliptag-288167269\blipupi83{\*\blipuid eed2ea9b7dc3370ea75f35182c2549dc}010009000003c902000006000602000000000602000026060f000204574d464301000000000001007eae0000000001000000e003000000000000e00300000100
00006c000000ffffffffffffffff3c0f00003200000000000000000000007e400000d400000020454d4600000100e00300001b00000003000000000000000000
0000000000009f120000a61a0000ca0000002101000000000000000000000000000010150300e8680400160000000c000000180000000a000000100000000000
00000000000009000000100000003c0f000032000000520000007001000001000000a4ffffff0000000000000000000000009001000000000000044000224300
61006c00690062007200690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1100f09a110010000000549e1100d49b1100524f6032549e11004c9b110010000000bc9c1100389e1100244f6032549e11004c9b110020000000076f2e314c9b
1100549e110020000000ffffffff1c854301826f2e31ffffffffffff0180ffff01803fff0180ffffffff00000100000800000008000043000000010000000000
00005802000025000000372e90010000020f0502020204030204ef0200a07b20004000000000000000009f00000000000000430061006c006900620072000000
000000000000149c110010232e3130be0f32749f1100809b1100ca3927310600000001000000bc9b1100bc9b1100087a253106000000e49b11001c8543016476
000800000000250000000c00000001000000250000000c00000001000000250000000c00000001000000120000000c00000001000000180000000c0000000000
00025400000054000000000000000000000035000000310000000100000052998740b98f87400000000057000000010000004c00000004000000000000000000
00003c0f00003200000050000000200000003600000046000000280000001c0000004744494302000000ffffffffffffffff3c0f000032000000000000002100
000008000000620000000c0000000100000024000000240000000000003e00000000000000000000003e00000000000000000200000027000000180000000200
000000000000aca8990000000000250000000c00000002000000250000000c000000080000805600000030000000ffffffffffffffff3c0f0000320000000500
0000fcfffcfffcff8c01dc798c01dc79fcfffcfffcff250000000c00000007000080250000000c00000000000080240000002400000000000041000000000000
000000000041000000000000000002000000220000000c000000ffffffff4600000014000000080000004744494303000000250000000c0000000e0000802500
00000c0000000e0000800e000000140000000000000010000000140000000400000003010800050000000b0200000000050000000c0207002202040000002e01
18001c000000fb02f3ff0000000000009001000000000440002243616c6962726900000000000000000000000000000000000000000000000000040000002d01
0000040000002d010000040000002d0100000400000002010100050000000902000000020d000000320a0c000000010004000000000023020700200d08000300
00001e0007000000fc020000aca899000000040000002d01010008000000fa02050000000000ffffff00040000002d0102000e00000024030500000000000000
070023020700230200000000000008000000fa0200000000000000000000040000002d01030007000000fc020000ffffff000000040000002d01040004000000
2701ffff1c000000fb020200010000000000bc02000000000102022253797374656d0000000000000000000000000000000000000000000000000000040000002d010500040000002d010500030000000000}}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid9441560\charrsid9441560 
\par }\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar
\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 
\af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00020000000000000000}Introduction{\*\bkmkend SECTION00020000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00021000000000000000}What is this Document About?{\*\bkmkend SECTION00021000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This is a document about coding demos on the C-64. With the additional help of some references, you should be able to learn how to code demos by reading this document and writing some code.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00022000000000000000}Why Did I Write This Document?{\*\bkmkend SECTION00022000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
There were several things that got me started writing this document. First of all, I didn't know of any good tutorial about demo programming on the C-64. There's Coders World, of course, but it may n
ot be thorough enough with the initial details. After all, the hardest problem is to get started at all.
\par Another reason was that people sometimes ask me things about coding, so in a way this is also some kind of an FAQ. Not that I've been asked about all these things, of course, I've filled in quite a lot of gaps.
\par The most important reason, though, is that I want people to learn to code demos on the C-64, and if the availability of a document like this can make someone start coding, that'd make me very happ
y. The C-64 scene is slowly fading into oblivion, with fewer and fewer releases, and I think what's missing the most is a new generation of coders who want to astonish people with amazing effects. And if you want to do that, you have to start somewhere, a
nd that somewhere is, in my opinion, not with 8x8 plasmas, but with the kinds of stuff that I go through in this tutorial.
\par I'm not claiming to be a good coder. Not even an average one. But I know some of the basics, and I'm trying to share that knowledge here.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00023000000000000000}Contributors{\*\bkmkend SECTION00023000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Thanks to BlackJack for reading through the text and suggesting changes. Thanks to some others, including Yodelking, Mr. Howard and Krill for pointing out errors.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00024000000000000000}Update note{\*\bkmkend SECTION00024000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
I've updated this a little bit. Two small bugs in example code are gone, and some small changes have been made here and there in the text.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00030000000000000000}Why C-64 Demos?{\*\bkmkend SECTION00030000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Before we start programming we should probably ask ourselves two questions:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls2\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Why program demos?
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Why use the C-64?
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00031000000000000000}Why Demos?{\*\bkmkend SECTION00031000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
It's pretty obvious why you'd want to program demos; because it's fun. You get all the usual advantages of doing programming, that you're learning about programming and that it's fun. You also get the added advantage that the resulting programs are cool a
nd nice to look at (if you're good at it). And of course, demos is more fun than most other things you can program.
\par Another good thing about programming demos is that you'll learn about many different aspects of the computer, at a very low level. To get goo
d performance (which is very important in demos), you need to write efficient code, and the only way to do that is to bang directly on the hardware (on the C-64, anyway). You don't use any kind of libraries or abstractions when you program demos, you do i
t all the hard way. So you need to understand how you make graphics appear on the screen, music to be heard from the speakers and how to load stuff from disk.
\par You also need to use interrupts, which is something you really need to know about if you're ever g
oing to write an operating system. It is also one of the things that is considered to be difficult to understand. Don't let that scare you, though, it's a pretty easy principle to understand, and as soon as you've gotten it to work once, you can probably 
do it much more easily the next time.
\par All in all, in coding demos you learn how a computer works at a very fundamental level, and understanding that makes lots of other things in programming easier. I'll just take one example: novice C programmers often hav
e lots of problems with pointers. Well, if you've written some machine code programs you know what pointers are and that they're not dangerous{\*\bkmkstart tex2html1}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot22" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 1}}}
\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html1}.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00032000000000000000}Why C-64{\*\bkmkend SECTION00032000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The second question I posed above was why you'd want to program your demos on a C-64. There are numerous very good reasons why you should use a C-64, some of which are applicable to some other hardware platforms as well, and some which aren't. I'll 
list some of my favourite reasons here.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00032100000000000000}The CPU{\*\bkmkend SECTION00032100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The CPU in the C-64 is a 6510, which is a variant of the 6502. It's a very nice processor to program. It has a simple instruction set, so it's easy to get started. It has been studied a lot and there's lots o
f documentation available. It uses memory mapped I/O, which means that performing I/O (like showing stuff on the screen) is no different than putting a value at some arbitrary memory location.
\par Of course, the 6502 only has three registers (not counting the 
PC, SP and Status register), which can make it a pain in the ass to implement complicated algorithms on, but on the other hand, it sure makes you appreciate a modern RISC processor with dozens of general-purpose registers.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00032200000000000000}The VIC{\*\bkmkend SECTION00032200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 The VIC (the graphics chi
p) is very nice. The VIC has a lot of interesting bugs (or features, depending on how you look at it), which means you can create amazing effects that are unique to the C-64. It's all about learning about the hardware and learning how to use it to fit you
r needs, not just blindly following a specification document.
\par Most of these effects are achieved through well-timed modifications of VIC registers. That's one of the things are most important in demo program: to use perfectly timed code. Creating raster bar
s on the Amiga is easy: just put some values in the copper list. On the C-64, on the other hand, you have to change $d020 and/or $d021 at exactly the right time, or you'll get flickering bars.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00032300000000000000}It's Old and Slow{\*\bkmkend SECTION00032300000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
That the C-64 is old and slow might not sound
 like much of an advantage, but when it comes to demo programming, it is. Why? It means that it's difficult to do stuff that requires lots of computations. You can't just throw CPU cycles at it, and write inefficient code. You have to think, to make it ef
f
icient. And doing really difficult things is what demo programming is all about. A good programmer can write a program that does something that seems very hard to do. A good demo programmer can write code that does something that is considered completely 
impossible.
\par There used to be a conservative rant here about how real demos are written in assembler and stuff like that, but most demos these days are written in high level languages and co-exist with an operating system, which means no direct hardware acce
ss etc. Demos for more powerful platforms are more about design than code these days anyway. But this isn't the right place to rant about that, so I removed it.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00040000000000000000}Learning Machine Language{\*\bkmkend SECTION00040000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
First of all, you need to learn 6502 assembly language. I'm not going to include a tutorial on assembler programming here. I'll just give a few examples and give pointers to some other good documents.
\par I'd suggest you do the following to learn assembler: get a tutorial, and try to grasp the general structure of it, learn som
e of the more important instructions, and then get a good reference, like ``Programmer's Reference Guide''. You shouldn't read the whole book, as most of it explains how to program the C-64 in BASIC. But the summary of the opcodes is nice, so that's a goo
d reason to keep the book.
\par There's a pretty nice assembler tutorial in the first couple of issues of Commodore Hacking.
\par When you've learned some assembler, you need to know which memory addresses to poke values into to make interesting things happen. As the
 C-64 uses memory mapped I/O, you perform I/O operations just by putting values into memory locations, or reading from memory locations. What you need is a memory map, that tells you which addresses are special, and which ones are just RAM. ``Mapping the 
C-64'' is a nice and detailed memory map.
\par If you think you're really smart, you shouldn't even need a tutorial on assembler, all you need is a reference document and some examples. So let's look at some really simple examples.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00041000000000000000}Flashing the Border{\*\bkmkend SECTION00041000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 A very sim
ple effect, that shows how you can achieve some things on the C-64, is to make the border flash in different colours. Here's the code to do it{\*\bkmkstart tex2html2}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot253" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 2}}}
\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html2}:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $1000
\par 
\par loop:      inc $d020 ; increment $d020
\par            jmp loop  ; jump to label loop
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
That was a short program, wasn't it? If you type in and run this program{\*\bkmkstart tex2html3}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  
HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot35" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 3}}}\sectd \ltrsect
\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html3}
, you will see the border flashing wildly. If you're using an assembler like Turbo Assembler or AssBlaster, you should just have to tap the RESTORE key to get back to the assembler.
\par Let's explain exactly what the program does. On the first line, we simply tell the assembler that the machine code it creates should start at memory address $1000 (1000 hexadecimal, which is the same as 4096 in the decim
al number system). This is Turbo Assembler syntax. If you're using some other assembler, consult the documentation.
\par The second line has a label, loop, which is just a way to name that memory location, ie. the one where the instruction inc $d020 starts. As 
we have told the assembler to assemble the code to address $1000, we know that what the label loop represents is actually $1000.
\par After the label comes an instruction, inc $d020, which tells means ``increment whatever value is at the address $d020 in place'
'. This is the same thing as loading the value from $d020 (using the instruction lda $d020), adding 1 to it (adc #$01) and then storing it in the same address (sta $d020). Why do we do this? Because the C-64 has memory mapped I/O, and the adress $d020 act
ually represents the border colour. So by putting different values in $d020, we change the colour of the border. So if it was initially black (value 0), it will be white (value 1) after executing the instruction inc $d020.
\par Then we come to the last line, whi
ch says jmp loop. When the program flow reaches this line, it jumps to the adress corresponding to the label loop and keeps executing instructions there. In our case, it will jump back to the previous line and execute inc $d020 again. Then it will again r
each the jmp loop line, go back, increment the border colour etc., forever. Or rather, until we press RESTORE, which will take us back to the assembler, or if we reset the computer or whatever.
\par So, now you know how to flash the border. If you use some other
 address than $d020, you can change other things. Some addresses will just give weird results, others will give sane results. If you use $d021 instead of $d020, the main screen will flash instead.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00041100000000000000}Clearing the Screen{\*\bkmkend SECTION00041100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Let's just take another simple example,
 that shows some other instructions, and actually does something useful. What we'll do is to clear the screen. That may not sound very interesting, but it's something you'll need to do at the beginning of most demo parts you write, so it's actually useful
. And of course, after you have cleared the screen, you can just jump to some other routine, like eg. the one that flashes the border.
\par Here's the code to clear the screen:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $1000
\par 
\par            lda #$00      ; Put the value 0 in accumulator
\par            sta $d020     ; Put value of acc in $d020
\par            sta $d021     ; Put value of acc in $d021
\par            tax           ; Put value of acc in x reg
\par            lda #$20      ; Put the value $20 in acc
\par clrloop:   sta $0400,x   ; Put value of acc in $0400 + value in x reg
\par            sta $0500,x   
\par            sta $0600,x   
\par            sta $0700,x
\par            dex            ; Decrement value in x reg
\par            bne clrloop    ; If not zero, branch to clrloop
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
So, how does the program above clear the screen? The comments should explain most of what goes on, but here's an overview:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls3\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
We start by setting the border and background colours to black. The value 0 means black, and, as you probably remember from the last example, $d020 and $d021 are the addresses that control the colour of the border and the main screen.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Now we want to remove all the characters from screen memory. Screen memory is by default located at $0400, and is $400 bytes long{\*\bkmkstart tex2html4}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot54" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 4}}}
\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html4}
, so we need a loop to clear it all. We clear it by setting every character position to $20, which is the character code for the space character.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Note how cleverly we handle the loop index, in the X register. We start by
 setting it to 0. Then we decrement for each iteration and then compare it so 0. The first time we decrement it, it will wrap around to $ff, and then it will go all the way down to 0 again.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If there's anything about this test program that you don't understand, look up the instructions and the various addressing modes in your 6502 assembler reference.
\par Note that this program won't behave very well if you just type it in and run it, because it d
oesn't really end. After the loop has finished, it will just happily get whatever is at the address after the loop and try to execute it as an instruction. That will probably not work very well, and something weird will happen. You will have to figure out
 yourself how to make it behave. One idea is to end this program by appending the border flashing code from the previous example.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00050000000000000000}Tools{\*\bkmkend SECTION00050000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Before we jump straight to demo programming, I need to introduce some tools. The necessary tools are a monitor and/or an 
assembler. You can choose to do your programming either in a monitor or an assembler. Which choice is the best is up to you. People have different opinions, but these days most people would probably say that an assembler is the best choice, because it mak
e
s programming more easy, as you can move stuff around, insert code into already existing code, add comments and use labels. On the other hand, if you program in a monitor, you know exactly where in memory your code is and you know where the page borders a
re, something which is really important when it comes to writing code that needs perfect timing.
\par Anyway, I'll try to describe how you can do some stuff with a monitor and with an assembler. All the example code in this text is in Turbo Assembler format, so 
maybe it's easiest for you to use Turbo Assembler to start with. The reason why I use Turbo Assembler format is that most people in the scene use Turbo Assembler, and I use it myself.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00051000000000000000}Using a Monitor{\*\bkmkend SECTION00051000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The monitor I'll describe here is a pretty standardized 
one, and the commands described should work on most monitors, like the ones in the Action Replay and Final Cartridge cartridges. There are some exceptions, like S-Mon, and if that's the only monitor you have, you'll have to find out how it works on your o
wn.
\par To write new code, you type in a line like
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560 .a 1000 lda #$00
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
What this does is that it assembles the instruction lda #$00 and puts the resulting machine code at the address $1000. You can now simply type the next line of code, as the monitor itself should now give you a line that looks like this:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560 .a 1002
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
That is, the monitor itself calculates where you want to put the next instruction, so if you want to type in a whole program, you only have to issue the a command once yourself.
\par To start a program, you simply jump directly it, using the g command, eg.:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560 .g 1000
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This will jump directly to the address $1000. To look at the code in memory, eg. the code you've already written, use the d command, like this:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560 .d 1000
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This will disassemble the code in memory, starting at $1000. Different monitors will handle this differently, but most monitors should let you scroll through the code, using the cursor keys.
\par There are lots of more monitor commands, but this isn't a manual for machine code monitors, so I'll leave the rest to you.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00052000000000000000}Using an Assembler{\*\bkmkend SECTION00052000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Learning to use an assembler may be a bit more difficult than learning to use a monitor, but most people would probably think that it's easier to use an assembler than a monitor. When you've loaded and started Turbo Assembler 
(sys $9000), you end up in the editor, in which you write code. The syntax is just like the exemples in this text.
\par Most commands in Turbo Assembler are invoked by pressing}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 $ \\
leftarrow$ , followed by some other key. To assemble a program, use}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 $ \\
leftarrow$ - 3. This will assemble the program, and if you press s just after the assembly, the program is started automatically. When you're in the program, you can get back to Turbo Assembler by pressing RESTORE{\*\bkmkstart tex2html5}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot73" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 5}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html5}. If that doesn't work, you can reset and type sys $9000, which should bring you back, unless you've managed to overwrite the memory of Turbo Assembler.
\par Some other nice commands are:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls4\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 $ \\leftarrow$ - 5 - assemble to object file on disk
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}$ \\leftarrow$ - s - save source to disk
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}$ \\leftarrow$ - l - load source from disk
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}$ \\leftarrow$ - 1 - exit to basic
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The rest you'll have to figure out for yourself. There are documents available on the web about how to use Turbo Assembler. There are also lots of different versions floating around, some of which support macros and some of which support undocumented opco
des. You can try different versions to see which one you like best, but for now it shouldn't matter which version you use.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00053000000000000000}Cross Assemblers and Emulators{\*\bkmkend SECTION00053000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You can also use a cross assembler, which is a program that does the assembly for you on some other com
puter, like an Amiga or a PC, and then you can transfer the machine code to your C-64 and run it. You can also run your code in an emulator (preferably VICE), instead of on a real C-64. You should always test your code on the real thing before releasing, 
though, because there are some things that the emulators still can't emulate (like the $d020 bug and some sprite stuff).
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00060000000000000000}Demo Programming{\*\bkmkend SECTION00060000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Finally, we get to the interesting stuff, ie. demo programming. Now, there are a lot of things you need to know about i
f you're going to write a demo, so we'll have to decide where to start. A demo consists of graphics, sound and code. Of course, in this document we'll concentrate on producing the code, but you'll still need to know how to display graphics and play sounds
.
\par The sound in most demos is music, and playing music produced with some music editor, like DMC or JCH's editor, is very easy. You don't really need to make the music yourself either, you can always use someone else's music, as long as you give credit to th
e person who did the music. I'll show you what to do to play a tune in an example below, but first there are some basic concepts we need to cover, like synchronizing things with the screen refresh.
\par As playing music is so easy (unless you're going to do something really fancy), we'll concentrate on coding graphics effects, because that's really everything you need in a demo.
\par Of course, if you make a multi-part demo that can't be squeezed into memory, you'll need to load parts from disk. You don't have to write a loader yourself, though, as there are some very good loaders around already.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00061000000000000000}$d012{\*\bkmkend SECTION00061000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Cryptic header, right? $d012 might be the most important address of them all, when it comes to demo programming on the C-64. $d012 has two different functions:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls5\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 When read, it returns the number of the current raster line.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}When written, it is used to set the number of the line where the next raster interrupt will occur.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
We'll get back to raster interrupts later. You need to know about $d012 to understand them, so pay attention to the stuff in this section! The first item above is interesting, but it may not be obvious why it is interesting.
\par The current raster line is the line that is currently being redrawn on your screen. The whole screen is redrawn 50 times per second{\*\bkmkstart tex2html6}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot82" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 6}}}
\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html6}
. Each time it is redrawn from top to bottom, from the left to the right. So, if you want something to happen 50 times per second, all you have to do 
is to check the current value of $d012, and when it reaches a certain value, call the routine that performs the desired task. When finished, go back to checking $d012.
\par Now, there are 318 raster lines on a PAL machine, and one register can only store values
 between 0 and 255, so you need another bit to represent all 318 lines. That bit is bit 7 of $d011. So, bit 7 of $d011 is really bit 8 of $d012. Does that sound confusing? In that case, read this paragraph a couple of more times. So, if bit 7 on $d011 is 
set, $d012 represents raster lines greater than 255 ($ff), otherwise the lines between 0 and 255.
\par If you want to take the easy way out, and you don't need to synchronize to some specific part of the screen, use a $d012 value greater than $40, because $ff + 
$40 = $13f = 319. So you'll never get a value greater than $3f if bit 7 of $d011 is set. I'll show how you can use $d012 with an example:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $0801
\par 
\par            lda #$00
\par            tax
\par            tay
\par            jsr $1000 ; initialize music
\par 
\par mainloop:  lda $d012    ; load $d012
\par            cmp #$80     ; is it equal to #$80?
\par            bne mainloop ; if not, keep checking
\par 
\par            inc $d020    ; inc border colour
\par            jsr $1003    ; jump to music play routine
\par            dec $d020    ; dec border colour
\par            jmp mainloop ; keep looping
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Now, before you try this program out, you'll need to have a tune loaded into memory at $1000. Most tunes used in demos, intros and what have you are located at $1000, so you just need to rip a tune
, or get it some other way. The code before the mainloop just initializes the tune, ie. sets all registers to 0, and then jumps to the initialization routine. You don't have to know what the music routine does, but what it actually does is that it resets 
the registers of the SID chip.
\par After the initialization we move directly into the main loop. What the main loop does is that it loads the value from $d012, compares it to $80 (128 decimal, somewhere in the middle of the screen), and if it's not $80, it jump
s back to where it began, ie. to loading the value from $d012.
\par Now, as soon as the raster beam reaches line $80, the inner loop is exited, and we end up at the line that says inc $d020. What we do is that we increment the border colour, jump to the music p
lay routine, which executes and returns, and then we decrement the border colour and jump back to the main loop. Why do we change the border colour? Because it's a way to visualize how much time the music player routine takes. You'll actually not only see
 how much time it takes (in raster lines), but also where on the screen you're playing it, ie. where the raster beam is when you're in the music player routine.
\par In this example we've learned two things:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls6\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 how to use $d012 to synchronize things with the screen refresh, and

\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}how to play music.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
We will later show that this music player routine is in no way perfect, but it's a good illustration of some concepts, and it works pretty well. You should now be able to figure out for yourself how to do raster bars. The t
rick is that you wait for a certain raster line, then change the background colour (if you're on the normal screen, you have to change both $d020 and $d021, if you're in the upper or lower border, you only have to change $d020). You need pretty good timin
g to do that, but with a hardcoded delay between the colour changes, it should work well with code similar to the above example.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00070000000000000000}Graphics{\*\bkmkend SECTION00070000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Now it's time to move on to some more interesting stuff, making things happen on the screen. Of course, things have been happening with the screen in all the above examples, but not in a very controlled way.
\par To get things to happen on the screen, you need to know which VIC registers to put which values into. There's also the screen memory, which is normally located at $040
0, and the colour memory, which is located at $d800, and works like the screen memory, but doesn't contain character codes, but colour values of the characters on the screen. But the VIC is the most important thing, so we'll start with some VIC basics.

\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00071000000000000000}Sprites{\*\bkmkend SECTION00071000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00071100000000000000}Sprite Basics{\*\bkmkend SECTION00071100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Sprites can be used for lots of cool things. What's nice about them is that they can be moved around on the screen, without affecting the background. As you probably know already, the C-64 has 8 hardware sprites, so you can have 8 things
 moving around simultaneously, or synchronize their movement to make bigger objects move around the screen.
\par You probably know that there are ways to get more than 8 sprites on the screen, but we'll go through the basics before we reveal that trick. The basics of sprites consist of the following:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls7\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 displaying them,
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}setting their position,
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}changing their shape and
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}changing their colour.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
There are a number of things you need to do in order to make a sprite appear on the screen. You need to point it at a chunk of
 data, that defines what it should look like. Then you need to set the x and y coordinates. Of course, you probably also want to set the colour of the sprite. And, last but not least, you need to turn the sprite on. This is all the stuff that is listed ab
ove, and this is everything you need to be able to do to do some basic sprite effects, like moving them around on the screen, animating them, etc.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00071200000000000000}Sprite Pointers{\*\bkmkend SECTION00071200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The sprite pointers, ie. the adresses that contain the pointers to where the graphics data that is displayed on the screen as sprites, are located after the end of the screen memory, which is usually located at $0400. The screen memory takes up exactly 10
00 bytes (40 times 25 characters), so the last 24 bytes of the memory from $0400 to $0800 are free. The last 8 ones of these are the sprite pointers, and the 16 bytes before the sprite pointers aren't used at all, unless I'm completely mistaken.
\par So, the byt
e at $07f8 is the sprite pointer for the first sprite. Now, how do we fit a pointer into one byte? To represent an address in memory, we need two bytes. But sprite pointers are handled in a special way. First of all, you only point to sprite data that is 
l
ocated in the same VIC bank as the one where you keep the screen memory. There are four VIC banks, $0000-$3fff is the first one, the one that's used by default. A sprite takes up 63 bytes of data, but have to be aligned to 64 bytes, so you can put sprite 
data starting at adresses $0000, $0040, $0080, $00c0, $0100 etc.
\par So, how many sprites can you fit into one VIC bank? 256. And how many numbers can a byte represent? 256. Aha! Now we can understand how the sprite pointers work: if you set a sprite pointer to
 0, it will point to the address $0000, in the current VIC bank. If you set it to 1, it will point to $0040. If you set it to $80, it will point to $2000, and if you set it to $c0, it will point to $3000. Easy, isn't it? So, let's say you want to do a sim
ple animation, consisting of 8 sprites, with the sprite data placed at $2000 (up to $21ff). You start by putting the value $80 into $07f8, then change it to $81, then $82, and so on up to $87, then you'd start over from $80.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00071300000000000000}Important Addresses{\*\bkmkend SECTION00071300000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Now we move 
on to how you set coordinates and colours and turn on sprites. Turning the sprites on is simple. The sprites are numbered from 0 up to 7. The sprite whose pointer you set when you poke values into $07f8 is 0, the one at $07f9 is 1, and so on. You turn on 
the sprites by setting the corresponding bits in $d015. So, to turn on sprite number 0, you poke the value 1 into $d015. To turn on sprites 0 and 1, put 3 in $d015.
\par Setting the coordinates of the sprites are equally simple, with one small catch. The x coord
inate registers are $d000 (sprite 0), $d002 (sprite 1) and so on, and the y coordinate registers are $d001, $d003 etc. As these registers can only store one byte each, you can only set coordinates between 0 and 255. But the visible portion of the screen i
s 320 pixels wide! The solution is that there's an 8th bit for each x register in $d010. So, if bit 0 in $d010 is set, sprite 0's x coordinate is 256, plus the value in $d000. This might sound a bit complicated, but you'll get used to it pretty quickly.

\par Setting the colours is the easiest part. For single colour sprites, you just poke the colour value of each sprite into the addresses $d027, $d028 etc. Read your favourite VIC reference for information on other stuff that you can do with sprites...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00071400000000000000}Sprite Example{\*\bkmkend SECTION00071400000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Here's an example that moves a sprite around on the screen:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $0801
\par 
\par            lda #$01
\par            sta $d015    ; Turn sprite 0 on
\par            sta $d027    ; Make it white
\par            lda #$40
\par            sta $d000    ; set x coordinate to 40
\par            sta $d001    ; set y coordinate to 40
\par            lda #$80
\par            sta $07f8    ; set pointer: sprite data at $2000
\par 
\par mainloop
\par            lda $d012
\par            cmp #$ff     ; raster beam at line $ff?
\par            bne mainloop ; no: go to mainloop
\par 
\par            lda dir      ; in which direction are we moving?
\par            beq down     ; if 0, down
\par 
\par                         ; moving up
\par            ldx coord    ; get coord
\par            dex          ; decrement it
\par            stx coord    ; store it
\par            stx $d000    ; set sprite coords
\par            stx $d001
\par            cpx #$40     ; if it's not equal to $40...
\par            bne mainloop ; just go back to the mainloop
\par 
\par            lda #$00     ; otherwise, change direction
\par            sta dir
\par            jmp mainloop
\par 
\par down
\par            ldx coord    ; this should be familiar
\par            inx
\par            stx coord
\par            stx $d000
\par            stx $d001
\par            cpx #$e0
\par            bne mainloop
\par 
\par            lda #$01
\par            sta dir
\par            jmp mainloop
\par 
\par coord
\par            .byte $40   ; current x and y coordinate
\par dir
\par            .byte 0     ; direction: 0 = down-right, 1 = up-left
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
That's a bit more code than in the previous examples, but it shouldn't be hard to understand. Just read the code and comments and you should be able to understand it.
\par If you type in and run the example program (you should), you'll notice that the movement 
isn't very smooth. It's not like anyone would accept a jerky movement like that in a real demo, so you'll have to fix it. The question to ask is why it's moving so jerky. The thing is that we haven't turned off timer interrupts. This means that sometimes 
we'll be in the kernal interrupt handler while we're passing raster line $ff, which means we'll miss it, and the sprite movement won't be updated until the next frame. You'll learn more about interrupts later.
\par A good exercise, to get your hands dirty with s
ome more interesting sprite programming, would be to display several sprites at once, and make them move according to a sine table. With the help of your friend $d012, you should also be able to make a multiplexer, if you're really ambitious. You've got a
ll the tools, now all you have to do is to think it up and express it in code.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00072000000000000000}Character Graphics{\*\bkmkend SECTION00072000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Sprites isn't the only way to display graphics. Our next topic is character graphics. You might have tried to draw something using the built-in character set. 
That's not very easy, and the results usually aren't all that good. Of course, you don't have to use the built-in character set. Using a character set editor, you can draw your own character set, and more effects than you can imagine are implemented using
 character graphics. They don't even have to look like characters, if the trick is (as it often is) to update the character set in realtime.
\par Before we get into those kinds of tricks, we'll do what we usually do and go through the basics first.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00072100000000000000}Screen and Colour RAM{\*\bkmkend SECTION00072100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
As you should already know (from reading the section on learning ML), you change characters on the screen by putting the character values into screen memory. Screen memory is $03e8 bytes long and is located at $0400, unless you move it somewhere e
lse. The screen codes aren't the same as the PETSCII codes you use for normal text, so if you want to prepare text that should be put on the screen, make sure you save it as screen codes. Most demo related text editors and such already do that, so there's
 nothing to worry about.
\par Now, putting characters on the screen is cool, but it gets even cooler if you can give each character its own colour. You can do this by poking the colour values into colour RAM, which is always located at $d800 (you can't move it).
\par So, let's say you want the letter A to appear in the upper left corner of the screen, and you want it to be yellow. What do you do? You poke the screen code for A into screen memory, ie. put the value 1 into memory position $0400, and put the value for ye
llow, which is 7, in $d800.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00072200000000000000}Changing Character Set{\*\bkmkend SECTION00072200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The built-in character set isn't so hot, so if you're going to display text, you should usually load your own character set. Fortunately, this is very easy, and you can control the locations of both the ch
aracter set and the screen memory with one VIC register: $d018. You put the upper parts of two addresses into this register: the four most significant bits of the 14 bit{\*\bkmkstart tex2html7}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot102" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 7}
}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html7}\~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 address of the screen memory in the four high bits, and the four most significant bits of the 14 bit address of the character set in the lower four bits. Confused? Let's take an example...
\par Screen memory is $0400 bytes long, and it 
has to start on an address that is a multiple of $0400, so it can start at $0000, $0400, $0800, $0c00 etc. As I said, it's located at $0400 by default. A character set is $0800 bytes long, and has to start on an address that is a multiple of $0800, so it 
c
an be located at $0000, $0800, $1000, $1800 etc. Now, let's say we want screen memory to be where it usually is, at $0400, and we have a character set at $2000. We want the four most significant bits of the 14 bit address $0400, which is 1 (in binary, $04
0
0 is 0000 0100 0000 0000, and if you count 14 bits from the right, you get 00 0100 0000 0000, of which 0001 are the four most significant bits). We also want the four most significant bits of the 14 bit address $2000 (the character set). In binary, $2000 
is 0010 0000 0000 0000, which means the four most significant bits of the 14 bit address is 1000, which is 8.
\par So, what do we actually store in $d018? We want 1 in the four most significant bits and 8 in the four least significant bits, ie. $18.
\par Now, I may h
ave made this a bit too complicated. It's really not that difficult. Here's a trick: to find out which value to store in $d018, just count the number of $0400 chunks until the start of the address you're interested in. If your screen memory should start a
t $1800, you count $0000, $0400, $0800, $0c00, $1000, $1400. That's 6, so you use 6 in the upper four bits of $d018. Use the same values for the character set, but put it in the lower four bits of $d018.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00072300000000000000}Altering the Character Set in Realtime{\*\bkmkend SECTION00072300000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 I mention abov
e that you can make interesting effects by altering the character set in realtime. How do you do this? Well, if you've specified that you want your character set at $2000, you can start poking values in the addresses from $2000 to $2800, and see what happ
ens. As you're altering the character set that's used for displaying what's on the screen, the things on the screen will change immediately. You don't have to change anything in screen memory, just in the character set.
\par A classical example of an effect that
 you can do by poking data into a character set is a DYCP (Different Y Character Positions). A DYCP is a scroll text where the letters move up and down, independent of each other. You can figure out how to do it yourself, or read the article about it in C
ommodore Hacking.
\par An easier exercise than writing a DYCP would be to create some animated graphics by changing the character data. You can also use this to scroll text without using $d016, by ROLing the char data through character memory...
\par Here's a simple example program, that doesn't really do much, except illustrate what I've just written. It sets the position of the character set to $2000, and then alters it in realtime. Note that I'm using $d012, as always.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $0801
\par 
\par            lda #$00     ; black
\par            sta $d020    ; border background colour
\par            sta $d021    ; screen background colour
\par 
\par            tax          ; set X to 0 too
\par 
\par clrscreen               ; set all char codes to 0 
\par            sta $0400,x  ; on the screen
\par            sta $0500,x
\par            sta $0600,x
\par            sta $0700,x
\par            sta $2000,x  ; and set charset data to 0
\par            dex
\par            bne clrscreen
\par 
\par            lda #$18     ; screen at $0400, chars at $2000
\par            sta $d018
\par 
\par mainloop
\par            lda $d012    
\par            cmp #$ff     ; on raster line $ff?
\par            bne mainloop ; no, go to mainloop
\par 
\par            ldx counter  ; get offset value
\par            inx          ; increment it
\par            cpx #$28     ; if it's $28, start over
\par            bne juststx
\par            ldx #$00
\par juststx
\par            stx counter
\par 
\par            lda $2000,x  ; get byte nr x from chardata
\par            eor #$ff     ; invert it
\par            sta $2000,x  ; store it back
\par 
\par            jmp mainloop ; keep going...
\par 
\par counter
\par            .byte 8      ; initial value for counter
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Some small things in the example might have to be explained. The reason why I'm counting to $28, and not just 8 (which would be sufficient for inverting every byte that make up the character 0), is so that it won't be too fast t
o see what's going on. The reason why we're poking stuff into $2000 and up is that we're using character number 0. The data for char 0 starts at $2000, the data for char 1 starts at $2008, the data for char 2 at $2010 and so on.
\par Okay, that's all I'm going to say about character graphics right now. You know the basics, now all you have to do is to experiment and think up cool things to do with character graphics.
\par Note that I haven't mentioned multicolour character graphics. Using multicolour, you can get you
r characters to have 3 colours each, one of which is set in colour RAM, and two which are set in $d022 and $d023. The colours in colour RAM are of course different for every character, but $d022 and $d023 can't be changed for each character.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00073000000000000000}Bitmap Graphics{\*\bkmkend SECTION00073000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Character sets are good for a lot of things, but if you want a picture that covers the whole screen, a character set won't do, because you can't set every pixel on the screen, using only $0800 bytes. There are 320 x 200 pixels on the screen in hires mode
, and 160 x 200 in colour mode, so you need about $2000 bytes to have total control of the graphics on the screen.
\par However, if the picture you want to display is ``simple'' enough, ie. if large parts of it are empty, or if it's highly repetitive, so that i
t could be drawn with a single customized character set, you can of course just use a charset to display it, and you'll save yourself $1800 bytes of memory. There are tools to convert a bitmap to a character set + a screen memory, which of course requires
 that the information contained in the bitmap will fit into a charset.
\par If you've understood how character graphics work, you shouldn't have any problems understanding how to display bitmap graphics. I'll describe how you can display hires graphics and multicolour graphics in the Koala Paint format.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00073100000000000000}The Concepts of Bitmap Graphics{\*\bkmkend SECTION00073100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
When you display character graphics, you have to set $d018 to point to screen RAM and character set. If you want to display a bitmap picture, you have to do almost the same thing. Y
ou have to set the location of screen RAM (which is used for two sets of colours for each character (yes, in a way you're still using character)) and of the bitmap. The bitmap takes up almost $2000 bytes, and it has to be properly aligned, so you can't pu
t a bitmap at eg. $2800, it has to be at $2000, $4000, $6000 etc.
\par Before we go into the theory of how you display a bitmap, I'll give you an example, and then I'll explain what it does. The example requires that you have a Koala picture loaded at $2000. Koa
la pictures are usually loaded to $6000, so go into your monitor and type l ``filename'',08,2000. That will load your picture to $2000.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $0801
\par 
\par            lda #$00
\par            sta $d020   
\par            sta $d021    ; set border and screen colour to black
\par 
\par            tax
\par copyloop:
\par            lda $3f40,x  ; copy colours to screen RAM
\par            sta $0400,x
\par            lda $4040,x
\par            sta $0500,x
\par            lda $4140,x
\par            sta $0600,x
\par            lda $4240,x
\par            sta $0700,x
\par            lda $4328,x  ; copy colours to colour RAM
\par            sta $d800,x
\par            lda $4428,x
\par            sta $d900,x
\par            lda $4528,x
\par            sta $da00,x
\par            lda $4628,x
\par            sta $db00,x
\par            dex
\par            bne copyloop
\par 
\par            lda #$3b     ; bitmap mode
\par            ldx #$18     ; multi-colour mode
\par            ldy #$18     ; screen at $0400, bitmap at $2000
\par            sta $d011
\par            stx $d016
\par            sty $d018
\par 
\par mainloop:
\par            jmp mainloop ; keep going...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 As I stil
l haven't explained everything about bitmap mode, this might not be all that clear, but it's still a very small example program and it'll display a Koala picture just fine.
\par We start by making the border and background black. This isn't actually accurate, as the background colour is stored in the Koala format, so we really should have loaded the value from $4711 and put it in $d021, but that's not really important.
\par Next we start copying stuff. Why do we do that. Well, we'll keep using $0400 as screen RAM, so
 we'll have to copy the screen RAM, which, in the Koala format, is located at $3f40, to $0400. That's easy, you've seen that one before. The same goes for colour RAM, which starts at $4328, which will have to be copied to $d800.
\par When we have all the data i
n the right places, all we need to do is to tell the VIC chip what mode to go into, and where it should read data. We tell it to go into bitmap mode by setting $d011 to $3b, and by setting $d016 to $18 we turn on multi-colour mode. And then we tell it to 
read screen RAM at $0400 and the bitmap at $2000, by setting $d018 to $18.
\par The last line just loops forever, so that you get a chance to watch the picture. Hopefully you've found a nice one. :-)
\par If you don't know where to find a Koala picture, get a program
 like Amica Paint, Koala Paint or Color-X16, and draw your own pictures. You can of course also rip pictures from other people's productions, but please, don't use ripped graphics in your demos, that's lame.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00073200000000000000}The Screen Layout{\*\bkmkend SECTION00073200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The layout of the actual bitmap is a bit weird, especially if you're used to other architectures, which have nice, linear bitmaps}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~{\*\bkmkstart tex2html8}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot112" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 8}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html8}. A C-64 bitmap isn't linearly adressable, ie. you can't just count the pixels from left to right and index into it in an easy way.
\par The data in a C-64 bitmap are indexed very much like a normal charset. The first byte (in the above example $2000) is the top, leftmost byt
e. $2001 is the byte below that one, $2002 below that one, and so on, until $2008, which is the one to the right of $2000. So, basically, it's as if you'd read one character from a charset, and put that character in the top left corner of the screen, and 
then you read the next character and put next to that one, and so on, until you reach character 40, which is below character 0.
\par It's not really hard to understand, but it does make it a bit difficult to implement efficient bitmap effects, like plotters. Think about it!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00073300000000000000}Displaying Bitmaps{\*\bkmkend SECTION00073300000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Displaying a single-colour bitmap is just like displaying a multi-colour bitmap, except that you don't use colour-RAM. Why? Because all you need is a background colour and a foreground colour, and you can use the good old sc
reen RAM for that. For each byte in the screen RAM, you set the upper nybble to one colour value, and the lower nybble to another value (or the same value, but then you won't see anything of the bitmap).
\par The last paragraph might sound a bit cryptic, but ju
st try it out. Get yourself a nice hires bitmap (use some utility to create one, it should output a file that is 33 blocks long). Load that bitmap to some $2000 aligned address (like $2000), set $d011 to $3b, $d016 to $08 (single colour mode) and $d018 to
 $18. Then you can start poking values into $0400 etc., to see what happens.
\par Does that sound too simple? It is simple.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00080000000000000000}Interrupts{\*\bkmkend SECTION00080000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Okay, so far we've learnt a lot of useful things for putting graphics on the screen (and playing music, but that's almost too e
asy to mention). To sum it all up, we have all the tools we need to write programs that display graphics and play music. Multimedia programs, or something like that. We don't know everything we need to write demos, though. Demos, as I said in the introduc
tion, are quite different from programs that display graphics and play music.
\par All the example programs above have suffered from one great problem: they have been badly timed, and all movement (as well as the playback of the music) has been jerky and inexact
. We need to do something about that. You can't have a scroll text that doesn't move smoothly, or jittering raster bars, because that's the definition of lameness.
\par So, how do we do something about it? Well, we need to know a bit about interrupts. Of course, as a demo coder, you really need to know}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \ai\af0\afs27 \ltrch\fcs0 
\i\f0\fs27\cf1\insrsid9441560\charrsid9441560 everything}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
about interrupts, but we're not going to be that complete here. We're going to be complete enough so that you can easily learn the rest by reading your reference material and poking around in your computer yourself, though. Wizardry isn't about knowing}{
\rtlch\fcs1 \ai\af0\afs27 \ltrch\fcs0 \i\f0\fs27\cf1\insrsid9441560\charrsid9441560 most}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
of what there is to know, it's about being able to setup interrupt handlers after 20 beers (trust me, that's not easy :-).
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00081000000000000000}Why Interrupts{\*\bkmkend SECTION00081000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
I suppose we'll have to answer this question, although it might
 seem stupid. There really isn't anything that keeps you from writing demos that don't use interrupts. If you just know how to turn of the CIA interrupts, you're safe from all the jittering and flickering we've experienced so far. But there are more thing
s
 you can do with the help of interrupts, and you really need to know about them in order to have control over your computer. And demos are all about control. You'll also need to know about interrupts to be able to use an IRQ-loader, and if you're planning
 to ever write a demo that's bigger than what will fit in your computer's memory, you'll need to use a loader. And there's no excuse for not using an IRQ-loader these days.
\par In this text, we'll concentrate on raster interrupts, because that's what you'll use
 most often in demos. We'll also go into NMIs a bit, because it's very useful to know about them. And of course, if you've written a demo that looks great and that people love, it can feel pretty embarrasing if you can kill it just by pressing RUN/STOP + 
RESTORE...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00082000000000000000}What is an Interrupt?{\*\bkmkend SECTION00082000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
A fair question to ask at this stage is what an interrupt is. They're a very simple, and very efficient way of handling some things. They work pretty much like an alarm clock.
\par Let's say you're going to bed after a long night of demo coding, and you have to get up at eight in the morning, to go to school or work. What do you do? You set your alarm clock to ring at eight, and then you can safely go to sleep, without having to wor
ry, knowing that the clock will wake you up at eight. Until then, you can sleep all you want.
\par That's exactly how interrupts work: you set up an interrupt to wake up the CPU at some time and tell it to do something special, but until then the CPU can do its normal things. So, what you do when you set up an interrupt is to define}{\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \ai\af0\afs27 \ltrch\fcs0 \i\f0\fs27\cf1\insrsid9441560\charrsid9441560 when}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 the interrupt should happen and}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \ai\af0\afs27 \ltrch\fcs0 \i\f0\fs27\cf1\insrsid9441560\charrsid9441560 what}
{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 should happen when the interrupt is triggered.
\par On the C-64, you have some different types of interrupts to watch out for. You have two CIAs, 
which can both generate timer interrupts (tell the CIA to give you an interrupt after X clock cycles), you have the VIC, which can generate raster interrupts (generate an interrupt when we reach a certain raster line), sprite collision interrupts (generat
e an interrupt when two sprites collide) etc.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00083000000000000000}How to Implement Interrupts{\*\bkmkend SECTION00083000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Yeah, so how do you set up a raster interrupt? It's actually very easy, so I'll just give you some example code, and then explain it.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            * = $1000
\par 
\par            sei          ; turn off interrupts
\par            lda #$7f
\par            ldx #$01
\par            sta $dc0d    ; Turn off CIA 1 interrupts
\par            sta $dd0d    ; Turn off CIA 2 interrupts
\par            stx $d01a    ; Turn on raster interrupts
\par 
\par            lda #$1b
\par            ldx #$08
\par            ldy #$14
\par            sta $d011    ; Clear high bit of $d012, set text mode
\par            stx $d016    ; single-colour
\par            sty $d018    ; screen at $0400, charset at $2000
\par 
\par            lda #<int    ; low part of address of interrupt handler code
\par            ldx #>int    ; high part of address of interrupt handler code
\par            ldy #$80     ; line to trigger interrupt
\par            sta $0314    ; store in interrupt vector
\par            stx $0315
\par            sty $d012
\par 
\par            lda $dc0d    ; ACK CIA 1 interrupts
\par            lda $dd0d    ; ACK CIA 2 interrupts
\par            asl $d019    ; ACK VIC interrupts
\par            cli
\par 
\par loop:
\par            jmp loop     ; infinite loop
\par 
\par int:
\par            inc $d020    ; flash border
\par 
\par            asl $d019    ; ACK interrupt (to re-enable it)
\par            pla
\par            tay
\par            pla
\par            tax
\par            pla
\par            rti          ; return from interrupt
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Now, if you're not used to using interrupts, that might look a bit weird. It works, though, and I'm now going to tell you how. (Well, I'll try, anyway. :-)
\par We start by turning off all interrupts, with an SEI instruction. The reason why we do this is because if we get an interrupt in the middle of setting up
 interrupts, things can get messed up and the program can crash. These things happen. Ever had a demo crash unpredictably? Sometimes it works, sometimes it doesn't? The interrupt setup might be screwed up. Or there can be some other reason. Read the code 
and see if you can find it. :-)
\par So, anyway, after the SEI, the action begins. We start by turning off all CIA interrupts. We do this by poking $7f into $dc0d and $dd0d. To find out what the value $7f means, read some reference. At a later stage, you might b
e interested in finding out what the individual bits of those registers do. We then turn on raster interrupts, by setting the lowest bit of $d01a.
\par The next thing we do is to setup $d011, $d016 and $d018. You should recognize those by now. We always have to
 initialize them, and I usually do it at the same time as the interrupt setup. The only bit that's relevant in this context (interrupts) is bit 7 of $d011, which is the 8th bit of $d012 (as we have more than 256 raster lines, but I've already talked about
 that above).
\par So, let's move on to the next chunk of instructions, which includes $d012. We set a new address in the interrupt vector, $0314. This address simply specifies where the processor should keep executing code when an interrupt occurs. We point it 
to our interrupt routine, int.
\par In the interrupt handler code, we don't do much. First we flash the border, by INC-inc $d020 (and of course, this happens once every frame), then we ACK the interrupt (set bit 0 of $d019, which I usually do with ASL $d019, fo
r some reason (probably because that's how it was done in the example that I learnt about interrupts from). If we forget to do this, the interrupt will be triggered again, right after we return from this interrupt code. So we have to tell the VIC that we'
ve handled this interrupt, so that it is cleared.
\par Then we have to restore the register contents from the stack (these are stored there when the interrupt occurs), and then execute the instruction RTI, which returns from the interrupt. Quite often you won't 
see exactly this code, but instead of the last six lines you'll see a JMP to $ea31 or $ea81. $ea31 is the default interrupt handler, which does this and that that you'll want if you're in BASIC, but you won't need that crap when you're coding demos, so sk
i
p it. $ea81 just contains the same code as the last six lines in our program, so exactly the same thing happens, except that we waste three clock cycles (for the JMP) and that we save 3 bytes of memory. So it's a trade-off, kind of, but it's not often 3 c
lock-cycles or 3 bytes will bother you very much, so who cares?
\par Of course you can't jump to ROM routines if you've switched out kernal ROM, so it's a good idea to use the code above anyway.
\par There's a modification you can do to the code above, which might be
 nice to try, and give you some further insight into how interrupts work. Instead of JMPing around in the infinite loop (JMP loop), do RTS. And add JMP $ea31 instead of the last 6 lines. If you start the program from BASIC, you'll see that your interrupt 
routine starts executing, but you're still at the BASIC prompt, and can type in BASIC commands. Cool, huh?
\par In the rest of the text, I will be a bit more restrictive with explaining details. If you've come this far and understand most of it, and have tried t
yping in the programs and changing them a bit, as well as making your own routines, you should be able to cope with a bit less detailed explanations. If there's something you don't quite understand, consult your references, write some code and see what ha
ppens etc. And send me an email, telling me what you don't understand.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00084000000000000000}Playing music again{\*\bkmkend SECTION00084000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
It should be trivial for you to alter the interrupt example program to play music. All you have to do is to init the music before the interrupt initialization, and th
en do a JSR to the play routine in the interrupt handler routine. If you can't remember how to do this, check the example on playing music (without interrupts) above.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00085000000000000000}Using More Than One Interrupt Per Frame{\*\bkmkend SECTION00085000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Now, pretty often (if you're coding real demos), 
you'll want to have several interrupts occur each frame. Let's say you have some kind of raster bar effect, that's created by an interrupt routine that is triggered at line $20, then you have a scroller that starts at line $e0. You can do this in two ways
 (or more, but this is just an example): (i) just use one raster interrupt, and do the old $d012 polling to wait for $e0, or (ii) use two interrupts.
\par There's nothing wrong with the first approach, except that you may want to do something in the main loop as
 well (outside of the interrupts), and in that case you don't want to sacrifice all the rastertime between the two effects by using them for polling $d012.
\par So, we'll go for the second approach. Let's say the label for the first interrupt routine is intrast
er and the one for the second one is intscroll. In the interrupt setup we'll put the address of intraster in the interrupt vector ($0314) and set the value $20 in $d012 (to make the VIC generate an interrupt at line $20).
\par That's all very well, but if we do
n't do anything more, the interrupt at $e0 will never happen. What we'll have to do is change the values of $0314, $0315 and $d012 in the interrupt routines. So, at the end of the first interrupt routine (intscroll) we set $0314 and $0315 to the address o
f intscroll and $d012 to $e0, before we return from the interrupt. And of course, in the second interrupt routine, we'll have to set the values back, so that they point to the first interrupt routine, and line $20.
\par If this sounds confusing and you're thinking ``No, I'll just keep polling $d012 instead'', then please read the above paragraphs again. It'll make your life so much easier.
\par It'd probably be a good idea to try to write a small program, using the ideas explained here. Write two interrupt routines th
at do something simple, like change the background colour, and check so that you can make them both work. To make it more interesting, change the values of $d012 each frame (by adding or subtracting one from the value). That way, you can make your rasterb
ars move up and down.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00086000000000000000}Stable Raster Interrupts{\*\bkmkend SECTION00086000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If you've tried out the above, especially changing the background colour on different lines, you've probably noticed that the interrupts aren't stable; if the colour change happens somewhere in the visible area
 of the screen, you'll see that it jitters a bit. It might even jump a whole line up and down, if you're on a Bad Line.
\par The reason is that when an interrupt is triggered, an instruction is executing in the CPU, and that instruction will have to finish befo
re the jump to the interrupt handler takes place. As you can understand, there's a variable delay here, eg. a NOP only takes two cycles, and some memory manipulating instruction in an indexed addressing mode might take 7 cycles.
\par This can be pretty irritati
ng, and it can be pretty difficult to time some routines so that they look nice. On the other hand, you can do pretty much, although your interrupts aren't stable. For now, it should be sufficient to know that there are ways to make the raster completely 
s
table. You'll need a stable raster to do some advanced effects, like splits (raster bars that change colour in the middle of a line) and opening the side border. However, you can do stuff like opening the top and bottom border, sprite multiplexers, raster
 bars, scrollers, displaying FLI pictures, FLD and all kinds of stuff without having a stable raster.
\par Anyway, there are different ways to get a stable raster, and you'll want to learn it eventually, unless you want to be doomed to code simple effects or ugl
y-looking chunky crap effects (which sometimes don't seem to use any timing at all) for the rest of your life. These different techniques all have their fans, so I'll go through them quickly here:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls8\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Double interrupts. This one uses two interrupts: the first one sets up the second one and makes it happen when executing a NOP, so that the jitter is reduced to one cycle, and then a simple branch instruction at exactly the right time, to remove the last 
cycle of jitter. This technique seems to be very popular.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Sync with sprite. This technique utilizes the way sprite data is fetched. What you do is that you turn on at least one sprite, and at the right time, you execute some memory manipulating instruction,
 which is stalled by the sprite fetch, which makes it end at exactly the same time, a fixed number of cycles after the sprite data fetch is complete. This might sound complicated, but it's a lot simpler than the double interrupts method, and all you need 
to do is to turn on a sprite and do an INC at the right time.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Triggering a Bad Line. This one might have some undesirable side effects, but it's very simple. All you do is trigger a Bad Line (eg. by executing INC $d011), and voila!, you have a stable interr
upt. It might produce some garbage on the screen, but it's really simple. I discovered this one while coding a FLI viewer, and this is pretty much the basis for FLI.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Syncing with a Bad Line. I haven't tried this one myself, I just read about it in an IRC l
og I found somewhere on the web. Crossbow/Crest mentioned a method of getting a stable interrupt by using an INC at the right moment on a Bad Line. Try it out yourself.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
My personal favorite is to sync with a sprite. I find it to be a very clean and nice wa
y of getting a stable raster, without all the hassle of using the double interrupts method. Triggering a Bad Line probably isn't very good at all, but it simple and it works, although it can have side-effects that aren't very nice. Syncing with a Bad Line
 is probably a very good method, as Crossbow uses it. :-)
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00087000000000000000}NMIs{\*\bkmkend SECTION00087000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
I won't go very deep into NMIs here, I'll mostly explain how you can get rid of the problem with the RESTORE key. You can't just turn them off, because you can't do that (that's why they're call
ed non-maskable interrupts). What you'll have to do to disable NMIs is the trigger an NMI and then refrain from ACKing it. That way, no new NMIs can occur. The simplest way to do this is to setup a timer interrupt on CIA2 (which is the CIA that can genera
te NMIs), and just do an RTI in the NMI handler routine.
\par You set up an NMI handler just like an interrupt handler, but instead of setting $0314-$0315, you set the address in $0318-$0319, which is the NMI vector. Just set it to point to a routine that returns, and does nothing more. It's as simple as that.

\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00090000000000000000}Interesting Effects{\*\bkmkend SECTION00090000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
In the previous sections I have explained most of the basics that you need to know in order to code your own demos. You might not understand exactly how everything works, but if you've w
ritten some code, using the stuff I've explained above, you should have a fairly good grip on the basics.
\par However, although you now have most of the tools you need to create lots of effects, you might not have figured out exactly how they work. In this sec
tion I'll give some examples of cool effects. You can try implementing them yourself, or, even better, use the same concepts to implement something different and more original. But of course, there are some things that everyone who wants to code demos hav
e to do at least once, and most of the below examples should be such things.
\par I won't give you source code to write all these things. I don't think that should be necessary. You'll also learn a lot by figuring our the details yourself. You can find source co
de and more details about some of these effects, and others as well, in early issues of Commodore Hacking and all three issues of Coders World (see the References section below).
\par I'll try to sort these effects in order of increasing complexity, so the firs
t ones should be easy, and the later ones harder. But of course, that's individual. Anyway, text scrollers and raster bars should be easier than displaying a FLI picture or opening the side border.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00091000000000000000}Text Scroller{\*\bkmkend SECTION00091000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
I'll start with this one, not just because i
t's a simple effect, but because it's so fundamental in demo coding. If you can do a simple text scroller, you can then work on making it more interesting, by adding colours, different sizes of fonts, animated fonts, Y-moving scrollers etc.
\par Doing the basic
 scroller is easy. Of course you start by setting up an interrupt that occurs a few lines before the actual text that should be scrolled. There you read a variable, where you've stored the current value of $d016, which is the X-scroll register. The three 
lower bits of $d016 control the X-scroll, so you have 8 steps of scrolling, enough to scroll one whole character. With the value 0 in the three lowest bits, you'll have your normal screen, and with the value 7, it will be scrolled 7 pixels to the right.

\par So,
 what you'll have to do is to start at the value 7, and then decrement it by 1 (or 2, 3, 4 etc., if you want a faster scroller) every frame. When you already have an X-scroll value of 0, you can't decrement it, you'll have to reset it to 7 again. At the s
ame time you'll have to move the characters in screen memory one step to the left, and insert a new character in the character at the right end of the screen. Then you just keep going.
\par As I've said, a text scroller is a simple effect, but writing your first one isn't necessarily easy. So here are some suggestions from someone who can still remember the hassle of getting a simple text scroller to work:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls9\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Start by putting some characters on the screen and make the $d016 fiddling work. The characters should move 
to the left for 8 frames and then flip back to their original position and start moving to the left again. This happens pretty fast, so it's not easy to see that everything is really correct, but if you get this effect, you're on the right way.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}When you've
 got that working, add a loop that copies characters from teh right to the left on one line of the screen, eg. the first one, which starts at $0400 and ends at $0427. That is, copy $0401 to $0400, $0402 to $0401 etc. And of course, add a new value in $042
7 each time. You should now have a basic scroll.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Add a routine that reads from an area of memory where you've stored your scroll text. Make sure it wraps at the end. You can do this by eg. storing the memory position of the last character somewhere, or set an end mark, eg. $ff, at the end of the text.

\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
When you have a basic scroller going, you can add some colours to it (by changing the values in colour RAM, $d800 to $dbe7). One thing that has been used a lot is to have the outer characters have a darker colo
ur than the central ones, which can make it look like the characters are fading onto the screen.
\par You can of course to other things with colours, like move the colours with the characters, so that each character has its own colour. Or you can have different colours cycling through the scroller.
\par Then, of course, there are all sorts of things you can do with your scroller to make it look more cool:
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls10\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Use your own character set, and it'll look a lot nicer (the ROM charset isn't very hot).
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Use a different sized character set, like 1x2 or 2x2.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Make the scroller move at different speeds (by adding different values to $d016). Just make sure you move the characters at the right time, so that it doesn't jitter.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Use $d011 to move it up and down wh
ile it's scrolling from the left to the right. You can use the same concept there, copying characters, to make it scroll more than 7 pixels in the Y direction.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Use multi-colour characters.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Use your imagination...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00092000000000000000}Raster Bars{\*\bkmkend SECTION00092000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 I've already explained the basi
cs of raster bars above: change $d020 and/or $d021 on every line. There are some issues you have to pay attention to to make it work well. You don't actually need a stable raster to make it work, all you need is the correct delay values.
\par The easiest thing 
is to do it in the upper or lower border. Then you'll only need to change $d020, and there are no Bad Lines that mess things up for you. All you need to do then is to write a loop that takes 63 cycles to execute (65 if you have an NTSC C-64). In the loop 
y
ou read a colour value from a table (indexed by the x or y register), increment your index value, change $d020, do a delay, check if your index value has reached a certain value, otherwise branch back to the top. You'll also need to add some delay before 
the loop, to make it start at the right time.
\par It might seem a bit complicated to have to count the cycles that different instructions take, but you'll learn it quickly, and it definitely pays off. Of course you'll need some trial and error to get it to work the first times...
\par Some things can screw up the timing and make instructions take different amounts of cycles. If you're using sprites, they'll steal a few cycles on each line where they're displayed, so don't move sprites over your raster bars, at least 
not if they're changing Y coordinates. That requires much more timing.
\par You'll also have to watch the page boundaries. A branch that crosses a page border takes one cycle more to execute than normally. The same goes for indexed addressing modes. Your usual 
LDA addr,X instruction usually takes 4 cycles. But if addr is eg. $2080, and X is greater than $80, you'll cross the page boundary, and it'll take 5 cycles instead. In some cases it's much better to use a monitor, instead of an assembler, as you know exac
tly where the page borders are in your code.
\par By using different registers to count the times you do the loop and to index into the colour table, you can make the colours in the raster bar roll. Or use the same register, and alter the colour table itself each frame.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00093000000000000000}Opening the Top and Bottom Border{\*\bkmkend SECTION00093000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This is a simple trick, but it can be pretty cool to be able to put stuff in the upper and lower border. Of course it's even more cool to open the side borders, and conceptually that's equally simple, but it requires good timing.
\par To open the upper and lower border, you have the screen set up to display 25 lines of text (by setting bit 3 of $d011). Then, on the last line of the screen (on raster line $f8, $f9 or $fa), turn off that bit. The VIC will be fooled into n
ot checking where to turn on the border, as it ``thinks'' it's already on, and it won't turn it on. You have to set the bit again, so that the VIC will be fooled again the next frame, but you'll have to wait a couple of lines first, or you'll fool yoursel
f instead. :-)
\par You can display sprites in the upper and lower border, but not normal graphics. The same goes for the side border. However, the last address in the VIC page ($3fff in the default case, otherwise $7fff, $bfff and $ffff) will also be displayed,
 in black. So if you have another background colour than black, and the value in this address is not 0, you'll see a garbage pattern in the border area. You can actually use this for some effects... Use your imagination.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00094000000000000000}FLD{\*\bkmkend SECTION00094000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 FLD stands for Flexible Line Di
stance, and was first introduced in the Think Twice demo by The Judges, in 1986, I think. With this routine, you can delay the display of the next character line for an arbitrary amount of lines. Everything that is to be displayed below is delayed, so you
 can scroll the whole screen down.
\par What you have to do is to delay the next Bad Line. A Bad Line is triggered when the three lowest bits of $d011 match the three lowest bits of $d012. So what you do is that you take the value from $d012, add a value to it, 
eg. 2, set the upper five bits to 0 (by using AND #$07), set the upper bits appropriately (ORA #$18 for text mode) and STA $d011.
\par This means that $d012 and $d011 won't match on the next line. On the next line, you do the same thing again. And then you keep
 going until you think it's time to display the next text line. Of course you use a loop for this, and if you vary the number or times you go through the loop each frame, you can make text lines scroll up and down really easily. Combine it with a scroll t
ext, and you'll have a scroll text that moves up and down. Nice, eh?
\par And of course, you can use this routine just to get rid of Bad Lines, which can be handy if you want to do eg. colour bars on the main screen. Just do an FLD and change $d020 and $d021 every frame, and you don't have to worry about Bad Lines.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00095000000000000000}Sprite Multiplexer{\*\bkmkend SECTION00095000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The principle of sprite multiplexers is very simple, but it can be a hassle to get a working implementation sometimes. What you do is that you change the Y coordinates of the sprites
 while they're being displayed, and as soon as the sprite is finished, it'll get the new Y coordinate, which is a couple of lines below. Note that the new Y coordinate has to be at least $15 greater than the previous value, or it won't be displayed at all
 the second time.
\par It gets even cooler if you change the sprite pointers too, but that has to be done at exactly the right time, because you can change the sprite data in the middle of a sprite's display, and then it'll just look weird, unless you really kno
w what you're doing (it can be used for some advanced effects).
\par Use a sine table for the Y values, and find our where you have to change the coordinates.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00096000000000000000}Tech-tech{\*\bkmkend SECTION00096000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You might already have figured out that you can do a simple effect by changing the three low
er bits of $d016 (the X-scroll) on every line. If you haven't tried it, you should at least be able to understand what happens: each line will have its own X-scroll value. By changing the X-scroll value in an ordered manner, you can make the graphics wave
 back and forth. But you don't get more than 7 pixels worth of difference between the lines, which is a pity...
\par You've probably seen real tech-techs (they're not so common these days as they were around 1990), and they definitely have a greater difference than 7 pixels. You might think that you can do that by moving the characters in screen RAM, but you can't, beca
u
se screen RAM is only read each 8th line. What you have to do is to change the charset (using the four lower bits of $d018), to a new charset, which is shifted one character to the right. You can fit 7 charsets (you need space for the screen RAM too) into
 one VIC page (16 kB), which means you can make a 56 pixels wide tech-tech. Not bad, huh? It can be a bit tricky to get it to work the first time, though...
\par You can of course also change VIC bank (with $dd00), which means you can do the effect with graphics, not just with a charset logo, or just get a wider tech-tech.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00097000000000000000}FLI, AFLI, IFLI etc.{\*\bkmkend SECTION00097000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
FLI is a graphics mode that gives you more colours per character than a normal multi-colour pixel. To achieve this, you need 8 different screen RAMs, with different colour 
values. The effect is achieved by triggering a Bad Line on every line ($d011) and changing $d018 to point to a new screen RAM (but the same bitmap) each line. You do this for 8 lines, then you start over again.
\par A normal FLI picture starts at $3c00. The are
a between $3c00 and $3fff is colour RAM, which is copied to $d800 in the initialization. The area between $4000 and $5fff is taken up by the 8 different screen RAMs, and $6000 to $7fff is the bitmap. So the values you'll change between in $d018 are $08, $
18, $28 and so on up to $78.
\par AFLI is exactly the same thing except that it uses hires mode. As hires doesn't use colour RAM, an AFLI picture takes up $4000 bytes, and is laid out in the same way as a FLI picture.
\par IFLI is just like FLI, except that you have two FLI pictures, which you switch between every frame, as well as changing X scroll by 1 pixel. This is to give it the appearance of more colours and higher resolution, by interlacing it.
\par In all of these formats you'll see the so called FLI bug, which mea
ns that first three characters on every line are unusable. There's no way to get around this. In FLI and IFLI, you just have to set the values for these characters to 0, and they'll be black. In AFLI, they'll always be light grey, so if you want to have s
ome other background colour, you'll have to cover these three lines with sprites.
\par The FLI effect also has the side effect of giving you a stable raster, which is always nice, of course.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00098000000000000000}Opening the Side Border{\*\bkmkend SECTION00098000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If you've got a stable raster, you can open the
 side border in exactly the same way as you open the top and bottom borders, but instead of $d011, you use $d016, and instead of once every frame, you have to do it on every raster line, where you want the border to be opened. This isn't the first effect 
you should try to code, but if you've got a stable raster, give it a try.
\par A hint: use DEC $d016 and then INC $d016. To see that you're in the right place (just by the right border), use $d021 instead of $d016 when timing it.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION00099000000000000000}Plasmas, Bumpmappers, 3d effects{\*\bkmkend SECTION00099000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
As you might have noticed, I haven't explained stuff that's seen in many modern demos, like plasmas, bumpmappers, 3d effects etc. I'm not very much into this type of effects, although they can look nice sometimes. Not if they're displayed in 4x4 or 8x8, t
hough! (At least very seldom...) These aren't specific to the C-64, and you can find information about them in lots of places. If you can do a plasma on some other platform, you can do a plasma on the C-64.
\par The easiest (and ugliest) way to display it is to
 use 8x8, ie. a normal text screen, where you change the colours of the characters. Another way you can do is to fill a bitmap with a pattern of the values $55 and $aa, so that you get a mixture of two colours in each 8x8 block.
\par 4x4 is often used, and it u
ses a graphics mode called half-FLI, which forces a Bad Line each 4th raster line. Combined with the right char data and two screen RAMs, this gives you a screen with 80x50 resolution. It doesn't look very nice, but it can be a nice programming exercise..
. And it's popular, although chunky graphics modes seem to be going out of fashion. It's about time.
\par To do 3d effects with vector graphics, all you really need to know is how to put a pixel on a bitmap screen and draw a line. Once you've done that, you just need to optimize your code to make it smooth and nice.
\par A trick that is often used, to optimize all sorts of plotter routines, is to use a 16x16 chars area, where the first column has the chars 0, 1, 2, 3 etc. up to 15, the second column has 16, 17, 18 etc
. In this way, you get linearly indexable Y coordinates (0 to 127). The reason for using a 16x16 chars area is that it all fits into one character set. You can make the area larger by shifting charsets in the middle, but that'll make the plotter routine a
 bit more complicated.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000910000000000000000}The Rest{\*\bkmkend SECTION000910000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The rest you'll have to figure our yourself, or read about in other places. Of course, as I've suggested above, variations of these basic effects can be made, and combining two or more of them can give very nice results. You 
have to be a bit creative to make interesting demos.
\par Of course, there might also be VIC tricks that haven't been discovered yet, although it's getting less and less likely.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000911000000000000000}An Exercise{\*\bkmkend SECTION000911000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
As I've stated before, you won't learn demo programming by just reading about it. You need to write demos yourself. Before you start trying to use IRQ loaders and writing really advanced effects, try to write a part that consists of the following things:

\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls11\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 A logo at the top of the screen. You can draw it yourself, using some gr
aphics program. Either use multi-colour mode or single-colour hires.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
8 sprites moving around the screen in some sine pattern. This might be a bit tricky the first time you try to do it, but all you really have to do is to set up two tables, one for the X c
oordinates and one for the Y coordinates, and assign each sprite an offset into the tables. Then change these offsets each frame, and just read the values from the tables and poke them into $d000, $d001 etc. The easiest thing is of course to use tables th
at are $100 bytes long.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}A scroll text at the bottom of the screen.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
Raster bars in the top and bottom border. You don't have to open the border to do this, you just have to change $d020.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
A tune playing. You don't have to go through the hassle of learning to use a music editor, just rip a tune from some other demo. As stated earlier, they're usually located at $1000, and are often shorter than $1000 bytes, so often all you have to do is to
 start the demo, reset, go into the monitor and save the area from $1000 to $1fff.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You should of course familiarize yourself with some of the tools, so don't forget to pack and crunch this demo, so that you can just load it and type RUN to start it. See the Tools section below.
\par If you manage to put together a demo like this, you've come a long way. And if you do, please send it to me! It'd be really cool if people could actually learn to code demos from this document!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000100000000000000000}Tools{\*\bkmkend SECTION000100000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
In this section, which maybe shoul
d have been called an appendix, I'll go through some tools you'll need to use when putting together demos. There are lots of free tools available on the FTP sites and the web, and if you don't have Internet access, you can get them from your contacts. If 
you don't have any contacts either, send me a couple of floppies and you'll get them back, filled with nice tools. My address is at the end of this document.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000101000000000000000}Cartridges{\*\bkmkend SECTION000101000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You need one of these. Without a good cartridge, your life is going to be a lot harder. 
The most popular carts are the Action Replay series, in particular version VI. Those can be a bit hard to come by, though, so you might have to stick to a Final Cartridge, or some other cart. The most important features are a fast loader an a monitor. If 
you have those, the cart is pretty okay. You need the monitor to move things around in memory, debug code etc. And well, you really can't live without a fastloader...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000102000000000000000}Packers and Crunchers{\*\bkmkend SECTION000102000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Before you release something, you want it load as quickly as possible, and to take as little disk space as possible. To achieve this, you use a packer or a cruncher. For the best possible result, you use both.
\par Packers use run-length encoding (RLE), which is a simple compression technique. What it does is to check for conti
nuous sequences of the same character, and replace those sequences with that character and the count (marked up by a special markup character).
\par Crunchers are more advanced, slower and give better results, because they use a more advanced algorithm, which c
hecks for common sequences in the data, and replace those by references to earlier identical sequences. If you think crunching takes too long time, try getting an REU (Ram Expansion Unit) and a cruncher that uses it, as that can improve crunching speed a 
lot.
\par If you have a means to transfer stuff between your C-64 and a PC or Amiga, you might be interested in checking out Pasi Ojala's PuCrunch, which crunches your C-64 files on the PC or Amiga side. Of course it's very fast, and it also gives very good resu
lts.
\par Some packers (eg. Sledgehammer) let you link all the files that you want to pack. This can be nice, although I prefer the method of saving the whole memory area that I use and pack that. It's a matter of taste, I guess.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000103000000000000000}IRQ loaders{\*\bkmkend SECTION000103000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 An IRQ loader is a 
loader that does the loading in the main loop, without disturbing your interrupt routines. So it can load while you're displaying scrollers, rasterbars and sprites on the screen, and the people who watch the demo won't even notice, unless they have noisy 
drives or pay attention to the drive LEDs. Of course, the more raster time that is available, the faster your files will be loaded.
\par Most IRQ loaders work the same way, but some of them don't work on all drives, and some of they are faster. Some also offer d
ecrunching on the fly, which means you won't have to take care of decrunching yourself, after the file is loaded. Just load it and use the data right away.
\par You usually have an init routine, which just sets up the drive, and which can then be overwritten (t
o save memory), and then you have the loader routine, which you'll have to save until you've loaded the final part. There's usually some documentation, which will tell you the details of how to use it.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000104000000000000000}Sprite, Char, Graphics editors{\*\bkmkend SECTION000104000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Well, if you're going t
o make your own graphics, you need editors to produce them. Everything you need is available. If you have the opportunity, get your hands on everything you can find and try everything out. After a while you'll have found some good editors, that you can us
e. Of course, this goes for all kinds of tools.
\par The basic stuff you'll need is editors for multi- and single-colour bitmaps, fonts sprites etc. There are also all sorts of conversion programs, to convert between different formats. And as if that wasn't enou
gh, there are also editors for special purpose formats, like combinations of bitmaps and sprites. Some of them can even give you ideas for new effects...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000105000000000000000}Sine editors etc.{\*\bkmkend SECTION000105000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You'll need a sine editor to produce nice sine tables, to use for sprite movements, scrollers, plasmas and what have you. Most of them offer the same features, so just check out a few and you'll get what you want.
\par Some people don't use sine editors, but write small BASIC programs instead. That gives you more flexibility, of course. Here's a small example from BlackJack:
\par 10 L=256: REM length of table
\par 20 X=10: REM amplitude/2
\par 30 A=1024: REM address
\par 40 FOR I=0 TO 2*$ \\pi$ STEP 2*$ \\pi$ /L
\par 50 : POKE A,SIN(I)*Y+Y
\par 60 NEXT
\par He also adds: ``It's pretty easy to add stuff between line 40 and 60 to split a larger value into "X div 8" and "X mod 8" for scrolling big logos or similar things.'' If you want more interesting sine movements, you'll have to change line 50 (the SIN(I) p
art).
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000106000000000000000}Music editors{\*\bkmkend SECTION000106000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The most popular music editors still seem to be DMC and the JCH editor. JCH's editor works more like a tracker, while DMC is a more traditional C-64 music editor, where you only see one sequence at a time. The both offer full sound editi
ng capabilities, and the players offer decent rastertime and memory usage.
\par Some less used editors are Sidwinder by Taki/Natural Beat, which has a very optimized player, that takes up very little raster time, and EMS, by Odie/Cosine, which is, as far as I can tell, just as good as DMC and JCH.
\par A new editor that is meant to be as simple as possible to use is Odintracker. Unfortunately it doesn't have a very good packer, so the tunes take up huge amounts of memory. This might change, of course.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000107000000000000000}Text Editors and Scroll Text Writers{\*\bkmkend SECTION000107000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
In addition to the above, you need text editors, to edit your scroll texts and other texts in your demos. Some text editors let you set the size of the pages, which can be handy, if you're using fonts of non-standard sizes, or only us
e parts of the screen to display text.
\par Scroll text writers are used for (surprise) writing scroll texts, and are pretty similar to text editors.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000108000000000000000}Noters{\*\bkmkend SECTION000108000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Noters are used for writing notes to contacts and notes for releases. Personally I think it's cooler to 
produce a special note for each release, but for small releases you can always use a standard noter. Which one you choose doesn't really matter, as long as it can display text.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000109000000000000000}Other Tools{\*\bkmkend SECTION000109000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
There are other kinds of tools as well, but you'll have to discover those for yourself. Generally, if you find that you need a tool for something, it's pretty likely that someone else has already written it, so it's just a matter of finding it...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000110000000000000000}Common Pitfalls{\*\bkmkend SECTION000110000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
I put this section near the end of the document, because it'
s supposed to be more like a reference section. Whenever you get errors that seem mysterious, things that shouldn't happen, you can check here and see any of the things pointed out might be responsible for your problems.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000111000000000000000}Final Cartridge{\*\bkmkend SECTION000111000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 I don't know exactl
y what kinds of problems you might get with a Final Cartridge, but it's always a good idea to try your demos with the cart removed if you're using a Final Cartridge. If you get different results with the cart removed, you know that your problem is cartrid
ge related.
\par If you have any details to share about Final Cartridge problems, please get in touch!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000112000000000000000}Graphics at $1000 or $9000{\*\bkmkend SECTION000112000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If your sprites (bitmaps, charsets etc.) look like they get their data from the standard CBM charset, you've probably put them in th
e memory between $1000 and $1fff or $9000 and $9fff. You can't use these areas for graphics, because whatever you do, the VIC will always see the standard charset in these areas. This is probably why the music is almost always placed at $1000...
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000113000000000000000}Garbage in Vertical Border or Behind FLD{\*\bkmkend SECTION000113000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If you see black garbage in the top and bottom border or on the screen, while doing an FLD, and don't know how to get rid of it, simply clear the last byte of the current VIC bank, ie. $3fff for the first bank, $7fff for the 
second, and so on. Be warned though, that doing this without thought might give you other problems. If you have code in that memory position, setting $3fff to 0 might later crash your demo, or just make it misbehave.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000114000000000000000}Everything Works Until I Pack It!{\*\bkmkend SECTION000114000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 So yo
u get weird bugs after packing your demo? One possibility is a buggy packer. Another is that you're using un-initialized memory. The situation won't be the same after packing, as the memory positions you're counting on always being set to 0 might now have
 some other value.
\par If you think the packer or cruncher you're using is buggy, try another one. If your demo looks different with different packers and crunchers, stick to the ones that others recommend. It's not likely that eg. Sledgehammer II or The Crunch
er AB have bugs. People have used these tools in thousands of products, so if they'd had bugs people would have discovered and fixed them.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000120000000000000000}A Few Words About Optimization{\*\bkmkend SECTION000120000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
As a general rule of thumb, you want the screen to be updated each frame, even if you 
do effects that use complex computations. With some effects, this isn't trivial. If you've written a nice effect, but the computations take more raster time than what's available in one frame, you have to optimize your code, or live with an effect that do
esn't look as nice as it could have.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000121000000000000000}What to Optimize{\*\bkmkend SECTION000121000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
There's a lot to be said about optimization, and I can't cram it all into a document like this. Furthermore, not every optimization is applicable to C-64 code.
\par If you ask a computer scientist, he or she will tell you that you should first improve your algorithms, and then, if it's still necessary, improve the constant times that each iteration takes. This makes perfect sense, if you want to sort 10000 numbers, y
ou shouldn't spend time optimizing your bubble sort routine, but instead implement some faster algorithm, like quick sort or merge sort.
\par But the algorithm usually isn't the problem with demo effects. The algorithm itself is most of the time pretty straightf
orward, and the problem is to get each computation as fast as possible. There's no way to decrease the number of iterations, but instead you have to decrease the time each iteration takes. This is the common case, I'd say, but there are lots of exceptions
.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122000000000000000}How to Optimize Computations{\*\bkmkend SECTION000122000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
So, how do you optimize computations written in 6502 machine code? There are lots of different ways, and I'm no expert, but I'll share some simple tricks, and hopefully you can use them and invent your own techniques for making your code run faster.

\par The basis of optimizing a computation is of course to decrease the time it takes, ie. decrease the number of machine cycles that each computation takes. Each instruction takes a few cycles to execute. You'll need a table with the ti
ming for the different instructions.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122100000000000000}Removing Instructions{\*\bkmkend SECTION000122100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
So the first rule of thumb would be: remove all unnecessary instructions. All instructions take a few machine cycles to execute, so by removing some of them, you're speeding up your code. An exampl
e of an instruction that can sometimes be removed without affecting the result is CLC. Read through the critical section of your code and try to find instructions to remove.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122200000000000000}Substituting Instructions{\*\bkmkend SECTION000122200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Sometimes you can rewrite a simple sequence of instructions to execute faster. Imagine that you want to increment a byte in memory, and use this sequence for it:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            ldx var
\par            inx
\par            stx var
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This is pretty bad, at least if you're not actually using the value afterwards. The above code takes}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 $ 4+2+4 = 10$ cycles. If you'd just used a simple INC var instead, you would have saved 4 cycles!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122300000000000000}Loop Unrolling{\*\bkmkend SECTION000122300000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Loop unrolling means that you optimize away the overhead that's inherent in all loops, ie. the code that changes and checks a counter and branches. Let's say you have the following loop in a speed critical section of a program:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            ldx #$00      ; 2 cycles
\par loop
\par            inc table,x   ; 7 cycles
\par            dex           ; 2 cycles
\par            bne loop      ; 3 cycles
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If you count the cycles in the above code, you'll see each iteration through the loop will take 12 cycles{\*\bkmkstart tex2html9}}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  
HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "foot215" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 9}}}\sectd \ltrsect
\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkend tex2html9}
. It's executed 256 times, which means that the total number of cycles used for the above code is}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
$ 256 * 12 + 2 = 3074$ cycles. That's quite a lot of raster time!
\par Let's unroll the loop and see if we can get it any faster... The code will look like this:
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 
\af2\afs20 \ltrch\fcs0 \f2\fs20\cf1\insrsid9441560\charrsid9441560            inc table     ; 6 cycles
\par            inc table+1   ; 6 cycles
\par            inc table+2   ; 6 cycles
\par            inc table+3   ; 6 cycles
\par            inc table+4   ; 6 cycles
\par 
\par            .
\par            .
\par            .
\par 
\par            inc table+253 ; 6 cycles
\par            inc table+254 ; 6 cycles
\par            inc table+255 ; 6 cycles
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
It's pretty obvious that this piece of code will need lots of more storage space (three whole pages), but let's say that we have lots of free mem
ory, so that isn't a problem. What about the execution time? Well, each instruction takes 6 cycles, so we'll use}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 $ 6 * 256 = 1536$ cycles. The used raster time is halved!
\par Of course, you won't gain as much as this in the usual case, but there's a lot of time to spare with this technique.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122400000000000000}Use the Zero Page{\*\bkmkend SECTION000122400000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
An LDA or STA to a normal memory address takes 4 clock cycles, but if you use an address in the zero page, they only take 3 cycles. Need I say more? Maybe, so here goes: use the zero page!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122500000000000000}Using Tables{\*\bkmkend SECTION000122500000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Why 
do people use pre-calculated sine tables? Because that means they don't have to do the costly sine calculations in real-time. That shouldn't be news to you. But if you think about it for a while, you might realize that you can use tables for lots of stuff
. Generally, if you have some kind of complex calculation, you can use lookup tables somewhere. If you're writing complex stuff with lots of shifts here and there, you can probably re-write that code to run in half the time by using a table.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000122600000000000000}Other Optimizations{\*\bkmkend SECTION000122600000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
The above techniques are just meant as examples of how to optimize code. The general idea should be pretty clear by now: do everything you can to make your code faster. Read through it and try to find ways to make it faster. Use tables, unroll loops, 
remove crap that's not necessary.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000123000000000000000}Other Ways to Make Code Faster{\*\bkmkend SECTION000123000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
There's of course a lot in truth in the rule that you should first optimize your algorithms, and then the constant factors. Don't think that there's no better way of achieving an effect than 
to use brute force. You can always cheat in some smart way, use data that makes the job easier and the code run in half the time.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000123100000000000000}Re-using Stuff{\*\bkmkend SECTION000123100000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
In some cases you can reuse results of computations in smart ways. If you realize that your code is, for some r
eason, computing the same value twice each frame, and the calculation takes some time, store the value in a table and just look it up the next time you need it.
\par Re-using stuff can even be as simple as plotting the same point in different places on the screen.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs27 \ltrch\fcs0 \b\f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000123200000000000000}Making Assumptions About Data{\*\bkmkend SECTION000123200000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Don't do the mistake of trying to write nice and general routines. If you think that's the way to go, you probably shouldn't be writing demos. With nice, general routines, you have to take care of special cases and take ca
re of weird data. But it's your code and your data, so your code should know what kinds of data it should expect. Don't make your code more complex than it needs to be. Only take care of the cases that can actually happen.
\par And of course, if you notice that your data demands a complex routine, think of ways to change the data, so that you can write a faster routine to handle it.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000130000000000000000}Other Documents{\*\bkmkend SECTION000130000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You'll need other documents, besides this little tutorial, or course. Below I list some references and some magazines with articles about demo coding.
\par Of course you'll also have to learn from the masters. When you watch a demo, try to figure out how the stuff you see on the screen is implemented, eg. what's done with chars and what's done with sprites, or where scrolli
ng is used and where the graphics data is updated in realtime. See the URLs below for places where you can find demos.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000131000000000000000}References{\*\bkmkend SECTION000131000000000000000}
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls12\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Mapping the C-64. This is a great memory map, with thorough explanations of all addresses in the C-64. It should be available at Project 64 (which also has some other useful documents): http://project64.c64.org/index.html.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Programmer's Reference Guide. Thi
s one has a nice table of opcodes, with cycle counts, addressing modes etc. Most of the book is pretty useless, though. This one should also be available at Project 64: http://project64.c64.org/index.html.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}All About Your C-64. This is a document put togeth
er by Ninja/The Dreams, which can be really handy. Especially the HTML version is nice to have available when coding, and you can't remember quite which bit it was that you had to fiddle with to achieve something. This one's available from the The Dreams'
 home page at http://www.the-dreams.de/.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}
The MOS 6567/6569 Video Controller (VIC-II) and its Application in the C-64, by Christian Bauer. This article should contain everything that is known about the VIC. There is a text version available at (it's also ava
ilable in HTML somewhere else): ftp://ftp.funet.fi/pub/cbm/documents/chipdata/VIC-Article.gz.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000132000000000000000}Magazines with Tutorials{\*\bkmkend SECTION000132000000000000000}
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls13\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
C=Hacking. Great online magazine with articles about everything concerning CBM's 8 bit computers. In some of the early issues there are a
rticles by Pasi ``Albert'' Ojala on demo effects. There's also a multipart Assembler tutorial in the first issues. Available from funet: ftp://ftp.funet.fi/pub/cbm/magazines/c=hacking/.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Discovery. I've only found three issues of this mag, but it has some n
ice demo-related articles, which you can learn a lot from. Like C=Hacking, the mag consists of ASCII text files that you can download off the Internet. Available from The Fridge: http://www.ffd2.com/fridge/discovery/.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Coders World. This is a disk mag, ie. 
a mag that you run on your C-64. Three issues were released, and they have a lot of simple code examples and explanations of how to make cool effects. This is a good resource for beginners. When you've learned a bit about the C-64, the info in this mag ma
y seem a bit too basic. You can find the first two issues at eg. funet: ftp://ftp.funet.fi/pub/cbm/magazines/disk/c64/. The third one is a bit hard to find. You can get it from me if you can't find it on the net.
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000133000000000000000}URLs{\*\bkmkend SECTION000133000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
If you've got Internet access, which is
 getting more and more common, and have a way to transfer stuff between the machine you use to access the Internet and your C-64, you have access to all the demos and tools you need. Below are a list of a couple of FTP sites which, taken together, should 
offer you everything you need. If you need something else, just do a web search.
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ltrpar\ql \fi-360\li720\ri0\sb100\sa100\sbauto1\saauto1\widctlpar
\jclisttab\tx720\wrapdefault\aspalpha\aspnum\faauto\ls14\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 ftp://c64.rulez.org/pub/c64/
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}ftp://utopia.hacktic.nl/pub/c64/
\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f3\fs20\cf1\insrsid9441560\charrsid9441560 \loch\af3\dbch\af0\hich\f3 \'b7\tab}ftp://ftp.elysium.pl/
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000140000000000000000}Contacting the Author{\*\bkmkend SECTION000140000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
You can contact me by email or snail-mail. The snail-mail address may of course change, so use email if you can. My email adress is puterman@civitas64.de. My snail-mail adress is:
\par Linus \'c5kerlund
\par Kantorsgatan 38
\par S-75424 Uppsala
\par Sweden
\par Please contact me and tell me what you think about this document!
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs36 \ltrch\fcs0 \b\f0\fs36\cf1\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000141000000000000000}Copying this document{\*\bkmkend SECTION000141000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 I'll
 try to keep this document as available as possible. For that reason, I'll release it into the public domain. Do what you want with it. Mirror it, copy it, change it, even sell it if you want to (if you can do that and still get a good night's sleep, capi
talist bastard). Please feel free to print it and hand out copies to your friends, relatives, pets and random gamer lamers.
\par I'll make this document available on my home page, which will hopefully be available for a long time at http://user.tninet.se/$ \\tilde\{ \}
 $ uxm165t/. That might change, though, and if you decide to upload it somewhere else, please tell me about it, so that I can add a URL here.
\par The document is written in LaTeX, and I'll make it available in source form (.tex file), as DVI, postscript, HTML and ascii text. Please convert it to other formats if you feel like it.
\par If you want to contribute changes, please change the text in the source and send the whole document to me, or as a patch (use the command diff, which should be available if you're on a Unix system).
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \ab\af0\afs48 \ltrch\fcs0 \b\f0\fs48\cf1\kerning36\insrsid9441560\charrsid9441560 
{\*\bkmkstart SECTION000150000000000000000}About this document ...{\*\bkmkend SECTION000150000000000000000}
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 An Introduction to Programming C-64 Demos}{\rtlch\fcs1 
\af0\afs27 \ltrch\fcs0 \f0\fs27\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This document was generated using the}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  
HYPERLINK "http://www.latex2html.org/" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 LaTeX2HTML}}}\sectd \ltrsect
\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 translator Version 2002-2-1 (1.71)}{\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid9441560\charrsid9441560 
\par }{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Copyright \'a9 1993, 1994, 1995, 1996,}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://cbl.leeds.ac.uk/nikos/personal.html" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 Nikos Drakos}}}\sectd \ltrsect
\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 , Computer Based Learning Unit, University of Leeds.}{\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \line Copyright \'a9 1997, 1998, 1999,}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://www.maths.mq.edu.au/~ross/" }}{\fldrslt {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 Ross Moore}
}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 , Mathematics Department, Macquarie University, Sydney.

\par The command line arguments were:}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \line latex2html -split 0 demo_prog.tex
\par The translation was initiated by on 2004-07-24}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 \~}{\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
{\pict{\*\picprop\shplid1026{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fillColor}{\sv 10070188}}{\sp{\sn fFilled}{\sv 1}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn alignHR}{\sv 1}}{\sp{\sn dxHeightHR}{\sv 30}}
{\sp{\sn fStandardHR}{\sv 1}}{\sp{\sn fHorizRule}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex936\picscaley6\piccropl0\piccropr0\piccropt0\piccropb0
\picw1764\pich882\picwgoal1000\pichgoal500\wmetafile8\bliptag1408230895\blipupi83{\*\blipuid 53efe5ef6f4dd241b6c3a51311e0a1f4}010009000003dd02000006001202000000001202000026060f001a04574d4643010000000000010014ab0000000001000000f803000000000000f80300000100
00006c000000ffffffffffffffff3c0f00003200000000000000000000007e400000d400000020454d4600000100f80300001d00000003000000000000000000
0000000000009f120000a61a0000ca0000002101000000000000000000000000000010150300e8680400160000000c000000180000000a000000100000000000
00000000000009000000100000003c0f000032000000250000000c0000000e000080250000000c0000000e000080120000000c00000001000000520000007001
000001000000a4ffffff000000000000000000000000900100000000000004400022430061006c00690062007200690000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000001100f09a110010000000549e1100d49b1100524f6032549e11004c9b
110010000000bc9c1100389e1100244f6032549e11004c9b110020000000076f2e314c9b1100549e110020000000ffffffff1c854301826f2e31ffffffffffff
0180ffff01803fff0180ffffffff0000010000080000000800004300000001000000000000005802000025000000372e90010000020f0502020204030204ef02
00a07b20004000000000000000009f00000000000000430061006c006900620072000000000000000000149c110010232e3130be0f32749f1100809b1100ca39
27310600000001000000bc9b1100bc9b1100087a253106000000e49b11001c8543016476000800000000250000000c00000001000000250000000c0000000100
0000250000000c00000001000000180000000c000000000000025400000054000000000000000000000035000000310000000100000052998740b98f87400000
000057000000010000004c0000000400000000000000000000003c0f000032000000500000002000ffff3600000046000000280000001c000000474449430200
0000ffffffffffffffff3c0f000032000000000000002100000008000000620000000c0000000100000024000000240000000000003e00000000000000000000
003e00000000000000000200000027000000180000000200000000000000aca8990000000000250000000c00000002000000250000000c000000080000805600
000030000000ffffffffffffffff3c0f00003200000005000000fcfffcfffcff8c01dc798c01dc79fcfffcfffcff250000000c00000007000080250000000c00
000000000080240000002400000000000041000000000000000000000041000000000000000002000000220000000c000000ffffffff46000000140000000800
00004744494303000000250000000c0000000e000080250000000c0000000e0000800e0000001400000000000000100000001400000004000000030108000500
00000b0200000000050000000c0207002202040000002e0118001c000000fb020200010000000000bc02000000000102022253797374656d0000000000000000
000000000000000000000000000000000000040000002d010000040000002d01000004000000020101001c000000fb02f3ff0000000000009001000000000440
002243616c6962726900000000000000000000000000000000000000000000000000040000002d010100040000002d010100040000002d010100050000000902
000000020d000000320a0c000000010004000000000023020700200d0800030000001e0007000000fc020000aca899000000040000002d01020008000000fa02
050000000000ffffff00040000002d0103000e00000024030500000000000000070023020700230200000000000008000000fa0200000000000000000000040000002d01040007000000fc020000ffffff000000040000002d010500040000002701ffff040000002d010000040000002d010000030000000000}}{
\rtlch\fcs1 \af0\afs24 \ltrch\fcs0 \f0\fs24\insrsid9441560\charrsid9441560 
\par }\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar
\ql \li0\ri0\sb100\sa100\sbauto1\saauto1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\outlinelevel3\adjustright\rin0\lin0\itap0\pararsid9441560 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 
\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\rtlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\cf1\insrsid9441560\charrsid9441560 Footnotes}{\rtlch\fcs1 \ab\af0\afs24 \ltrch\fcs0 \b\f0\fs24\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot22}... dangerous{\*\bkmkend foot22}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html1" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 1}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
A couple of guys, who weren't all that good at C, were writing a toy operating system. They got all sorts of bugs and weird crashes, and didn't know what to do. After a while they came up with a solution: to re-write the whole kernel without using any poi
nters at all. Don't ask me how they did it, but they did get it to work. Morale of the story: code some C-64 demos, and you'll never run into problems like that. :-)
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot253}... it{\*\bkmkend foot253}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html2" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 2}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This code should be pretty assembler neutral, ie. you can use whichever assembler you want. You can't type this stuff into a monitor, though, as it uses labels. If you're going to use a monitor, you have to change the JMP instr
uctions into jumps to absolute addresses, ie. change JMP loop into JMP $1000. You also need to remove the line * = $1000, which just means that the code should begin at the address $1000.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot35}... program{\*\bkmkend foot35}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html3" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 3}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 See the Tools section on how to do that.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot54}... long{\*\bkmkend foot54}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html4" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 4}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Actually, if you do your math, you'l
l realize that it's only $03e8 bytes long. Then follows $10 bytes that you can use for whatever you want, and 8 bytes that are the sprite pointers.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot73}... RESTORE{\*\bkmkend foot73}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html5" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 5}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
This doesn't work in all version of Turbo Assembler. If your version doesn't support this, you can add some code to do it for you.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot82}... second{\*\bkmkend foot82}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html6" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 6}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
On PAL systems, that is, on NTSC systems the screen is redrawn 60 times per second.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot102}... bit{\*\bkmkend foot102}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html7" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 7}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Why 14 bits? Because the VIC can on
ly address 16 kB of memory, which is what you get with a 14 bit address space.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot112}... bitmaps{\*\bkmkend foot112}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html8" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 8}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 Not as weird as mode X on VGA cards, though.
\par }\pard \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 {\*\bkmkstart foot215}... cycles{\*\bkmkend foot215}}
{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560  HYPERLINK "http://ocaoimh.ie/wp-content/uploads/2008/01/intro-to-programming-c64-demos.html" \\l "tex2html9" }}{\fldrslt {\rtlch\fcs1 \af0 
\ltrch\fcs0 \f0\fs27\ul\cf2\insrsid9441560\charrsid9441560 9}}}\sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid6389675\sftnbj {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 
\f0\fs27\cf1\insrsid9441560\charrsid9441560 
\par }\pard \ltrpar\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid9441560 {\rtlch\fcs1 \af0\afs27 \ltrch\fcs0 \f0\fs27\cf1\insrsid9441560\charrsid9441560 
Except the last one, which will only take 11 cycles, as the branch isn't performed.
\par }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid6389675 
\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8
72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7
2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b
44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7
065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000
00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08
84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc
52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353
bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468
656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c
070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7
29e245eb2b260a0238fd010000ffff0300504b03041400060008000000210096b5ade296060000501b0000160000007468656d652f7468656d652f7468656d65
312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87615b8116d8
a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad79482a9c04
98f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b5d8a314d3c
94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab999fb7b471
7509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9699640f671
9e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd5868b37a088d1
e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d60cf03ac1a5
193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f9e7ef3f2d1
17d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be15c308d3f2
8acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a99793849c26ae6
6252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d32a423279a
668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2af074481847
bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86e877f0034e
16bafb0e258ebb4faf06b769e888340b103d3311da9750aa9d0a1cd3e4efca31a3508f6d0c5c5c398602f8e2ebc71591f5b616e24dd893aa3261fb44f95d843b
5974bb5c04f4edafb95b7892ec1108f3f98de75dc97d5772bdff7cc95d94cf672db4b3da0a6557f70db629362d72bcb0431e53c6066acac80d699a6409fb44d0
8741bdce9c0e4971624a2378cceaba830b05366b90e0ea23aaa241845368b0eb9e2612ca8c742851ca251ceccc70256d8d87265dd96361531f186c3d9058edf2
c00eafe8e1fc5c509031bb4d680e9f39a3154de0accc56ae644441edd76156d7429d995bdd88664a9dc3ad50197c38af1a0c16d684060441db02565e85f3b966
0d0713cc48a0ed6ef7dedc2dc60b17e92219e180643ed27acffba86e9c94c78ab90980d8a9f0913ee49d62b512b79626fb06dccee2a432bbc60276b9f7dec44b
7904cfbca4f3f6443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc399161ee314bc2e75cf8759081743be1236ec4f4d6693e5336fb672c5dc24a8c33585b5fb
9cc24e1d4885545b58463634cc5416022cd19cacfccb4d30eb45296023fd35a458598360f8d7a4003bbaae25e331f155d9d9a5116d3bfb9a95523e51440ca2e0
088dd844ec6370bf0e55d027a012ae264c45d02f708fa6ad6da6dce29c255df9f6cae0ec38666984b372ab5334cf640b37795cc860de4ae2816e95b21be5ceaf
8a49f90b52a51cc6ff3355f47e0237052b81f6800fd7b802239daf6d8f0b1571a8426944fdbe80c6c1d40e8816b88b8569082ab84c36ff0539d4ff6dce591a26
ade1c0a7f669880485fd484582903d284b26fa4e2156cff62e4b9265844c4495c495a9157b440e091bea1ab8aaf7760f4510eaa69a6465c0e04ec69ffb9e65d0
28d44d4e39df9c1a52ecbd3607fee9cec7263328e5d661d3d0e4f62f44acd855ed7ab33cdf7bcb8ae889599bd5c8b3029895b6825696f6af29c239b75a5bb1e6
345e6ee6c28117e73586c1a2214ae1be07e93fb0ff51e133fb65426fa843be0fb515c187064d0cc206a2fa926d3c902e907670048d931db4c1a44959d366ad93
b65abe595f70a75bf03d616c2dd959fc7d4e6317cd99cbcec9c58b34766661c7d6766ca1a9c1b327531486c6f941c638c67cd22a7f75e2a37be0e82db8df9f30
254d30c1372581a1f51c983c80e4b71ccdd28dbf000000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f74
68656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f24
51eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e3198
720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d9850528
a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c0200001300000000000000000000000000
000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b000000000000000000000000
002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c00000000000000000000000000140200007468
656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d001400060008000000210096b5ade296060000501b000016000000000000000000
00000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b010000270000000000
00000000000000009b0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000960a00000000}
{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;
\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;
\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000
4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000
d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000e037
cb1dab30cc01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000105000000000000}}